Support

Account

Home Forums General Issues Clearing field with javascript, conditional rules

Solving

Clearing field with javascript, conditional rules

  • I have a text field, or URL field actually, that I’m trying clear with jQuery. That works fine, but using .val('') doesn’t seem to refresh the field so that any conditional rules get reapplied.
    I have another field which is set to be visible only if this field has no value set. Even though this field gets emptied via javascript, the conditional rule doesn’t seem to refresh until I select the field and hit backspace. Only after that the other field becomes visible.

    Any tips?

  • I have actually the same problem by set a hidden checkbox to false but the conditional rules are not applied to the dependend fields.

  • thats the way it works for a checkbox:

    $('#acf-field_pf_exhibition_zone_updated').prop('checked',false).trigger('change');

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.