APIs & Integrations

leandrof
Member

How to clear required "select" field

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
leandrof
Member

How to clear required "select" field

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

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

How to clear required "select" field

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

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

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

How to clear required "select" field

Hey @leandrof 

Why not use dependent field logic in the form builder?

0 Upvotes