How to clear required "select" field

leandrof
Member

I'm working on a form where, depending on the choice of field 07, it hides field 08 and selects the first option to avoid validation problems.

$(".hs_field_08").hide();
$("[name='field_08']").val($("[name='field_08'] option").eq(1).val()).trigger('change');

Depending on the choice of field 07, field 08 should be displayed again, at this moment I execute:

$(".hs_field_08").show();
$("[name='field_08']").val($("[name='field_08'] option").eq(0).val()).trigger('change');

However, because the field is required, the message "Please complete this required field" is displayed.

 

How to clear this validation? How to reset the select field without displaying this message?

0 Upvotes
3 Replies 3
dennisedson
Community Manager

Hey @leandrof 

Why not use dependent field logic in the form builder?

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
leandrof
Member

Is it possible to hide a field based on the selection of another?

0 Upvotes
dennisedson
Community Manager

I don't think that witchcraft available in the logic options.

@webdew , @tette_engage , @Oscar1 , do you all have suggestions?

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes