Skip to main content
Participating Frequently
February 23, 2022
解決済み

How do I make the dropdown required by not allowing the "Please Select Option" as selected answer

  • February 23, 2022
  • 返信数 2.
  • 7109 ビュー

Greetings!

May you please help me on how do I make the dropdown required and not allowing the "Please Select Option" as the selected option by the user.

Please see attached screenshot:

 

Thank you and hoping for your reply.

 

このトピックへの返信は締め切られました。
解決に役立った回答 Thom Parker

Set that field as required and then use this script as 'Validation' of that same field:

event.target.required = event.value == "Please Select Option" ? true : false;


A submit will be blocked when a field is both required and set to it's default value.  So make "Please Select" the default. I don't see any need for the script. 

 

 

 

 

返信数 2

try67
Community Expert
Community Expert
February 23, 2022

You will need to validate the selection using a script, before sending the file.

Is this the only field you want to check, or are there more?

Participating Frequently
February 23, 2022

Hi try67!

 

May you please help me with the script?

 

Known Participant
April 25, 2022

You should use both codes, yes.


Ok, so where in my form should I be using the first code you provided ?

Participating Frequently
February 23, 2022

Furthermore, this should not allow the user to submit the form unless it has met the requirement.

 

Thank You