Hi, in my form I use the events tab to add up values from several textfields into a "total sum" textfield. First save works just fine, but when trying to update that same form, if you change values from the fields it won't subtract and any other value you enter will sum to the previously loaded "total sum" value.
I thought that a reset button just for those fields (not for the entire form) would be a good solution, instead of coding a way to add or subtract depending on the new field value; but I can't figure out how to.
The reset-type button by itself won't clear any field, I think I'm missing a function or event. I created a button-type button and tried to javascript it to clear fields, but can't make it work. I don't know if the function js code goes before or after the button, or if I have to place something extra on the setup tab, or if it can be done with php.
Any suggestions on how to achieve this?
I thought that a reset button just for those fields (not for the entire form) would be a good solution, instead of coding a way to add or subtract depending on the new field value; but I can't figure out how to.
The reset-type button by itself won't clear any field, I think I'm missing a function or event. I created a button-type button and tried to javascript it to clear fields, but can't make it work. I don't know if the function js code goes before or after the button, or if I have to place something extra on the setup tab, or if it can be done with php.
Any suggestions on how to achieve this?
Hi xoles,
The reset button resets the fields to their default values when the form was loaded, so if your fields had some values already then the reset button can't clear them, instead you can clear them with JS:
Best regards,
Max
The reset button resets the fields to their default values when the form was loaded, so if your fields had some values already then the reset button can't clear them, instead you can clear them with JS:
$("#field_id").val("");
Best regards,
Max
Thanks Max, I'm trying with no luck this js code before the input field:
and a button with id 'reset' after the input field. All these on design tab; nothing extra on setup tab.
document.getElementById('reset').onclick= function() {
$("#field_id").val("");
};
and a button with id 'reset' after the input field. All these on design tab; nothing extra on setup tab.
This topic is locked and no more replies can be posted.