• Resolved attesz98

    (@attesz98)


    Hello, i have one checkbox and one dropdown field. My question, how to reset only dropdown?

    • This topic was modified 3 years, 2 months ago by attesz98.
    • This topic was modified 3 years, 2 months ago by attesz98.

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

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

    (@codepeople)

    Hello @attesz98

    Assuming you have the checkbox field (fieldname3), you can insert a button to reset this field with the following piece of code as its onclick event:

    jQuery('[id*="fieldname3_"]').prop('checked', false).change();

    Best regards.

    Thread Starter attesz98

    (@attesz98)

    So far so good, but the code only clears the checkbox, not the dropdown field.

    Plugin Author codepeople

    (@codepeople)

    Hello @attesz98

    If you want to reset both, and assuming the dropdown field is the fieldname177, the code would be:

    jQuery('[id*="fieldname3_"]').prop('checked', false).change();jQuery('[id*="fieldname177_"] option:eq(0)').prop('selected', true).change();

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to reset only dropdown?’ is closed to new replies.