• Resolved dareko

    (@dareko)


    Hello, I would like to create a Reset button for resetting values of the selected fields. The fields to be reset are grouped in one fieldset.
    I’ve tried the tip with
    jQuery(‘[id*=”fieldname74_”]’).val(‘ ‘).change();
    as OnClick event, but such button resets all fiels in the form.

    Please advise how to do it.
    Kind Regards

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @dareko

    Thank you very much for using our plugin. If your fieldset field is the fieldname1, the button click event could be:

    jQuery('[id*="fieldname1_"] :input').val('').change();

    Best regards.

    Thread Starter dareko

    (@dareko)

    Thank you very much for the quick answer (as usual).
    Unfortunately the solution above also resets all input values in the form.
    Best Regards
    Darek

    Plugin Author codepeople

    (@codepeople)

    Hello @dareko

    The solution reset all input values into the fieldset, but as I called the onchange event every equation that uses these fields is evaluated. If you want to reset the fields’ values without affecting the equations that use them, you can use:

    jQuery('[id*="fieldname1_"] :input').val('');

    Best regards.

    Thread Starter dareko

    (@dareko)

    The same result. It resets all input fields. Ater using it the calculator displays the predefined values of fields or null if there is no predefined value.
    It is independent of evaluation – I add the “calulate button” and untick “Dynamically evaluate the equations” in the form settings.

    Plugin Author codepeople

    (@codepeople)

    Hello @dareko

    Please, let me know where are you use the code exactly.

    Best regards.

    Thread Starter dareko

    (@dareko)

    Plugin Author codepeople

    (@codepeople)

    Hello @dareko

    The issue is simple. You are using the code into a reset button. If it is a reset button, it will reset all your form’s fields and then runs the onclick event. You should select the “Button” option as the button’s type.

    Best regards.

    Thread Starter dareko

    (@dareko)

    Eureka!
    Now it works!
    Thank you very much for the awsome support.
    Best Regards
    Darek

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘reset button for selected fields’ is closed to new replies.