Please can you add the ability to have a please select for dropdowns. i have a form where the item chosen is required but it always selects the first one anyway so you cannot make it a required field or have i missed something?
Please can you add the ability to have a please select for dropdowns. i have a form where the item chosen is required but it always selects the first one anyway so you cannot make it a required field or have i missed something?
Yea, currently if you have a "Please Select..." it would be a value so it would validate.
What you may want to do is make the first selection blank. No name at all. So the drop down wouldn't have a first value. If they don't change it, the form won't validate because the value is blank.
ill try the blank value for now. will this be something you might add in the future?
Yes, we will consider adding it in the future when we implement the ability to customize the option values for selection fields.
This is a workaround at best, just have jQuery set the value of the first option:
$('#input_id option:eq(0)').val('')
This will set a null value for the first option in the select. Just replace "input_id" with your select id.
UPDATE: Below was my original message but I just figured out how to do this without leaving a blank first option - your earlier answer gave me the clue.....so I enabled values (which, for anyone else reading this, if you don't enable values then your options are used as the values), then I deleted the value for my first option, which is a "Please select..." option......thus, no value means that the field will now validate as needed, and require the user to select a different option from the list. Yaay!
But I'm leaving my original message because this could be made more user-friendly, or explained better in the documentation.
----------------------original forum message-----------
I'd also like to cast a vote for making dropdowns have the ability to have a Please Select as the first option and still have it require a choice to validate.
The reason is that in some situations where space is very tight we don't use labels, and instead use the first item in the dropdown to tell the user what to do - e.g. "please select your part number"..... that makes it clear without the need for extra vertical or horizontal space for a label, but the field then can't truly be "required" - I'd love to see this feature soon.....
Is it now possible to:
1. Set the standard value of dropdown fields to i.e. "Please choose"?
(all dropdown fields in all forms/all dropdown fields in a specific form/specific dropdown fields in a specific form)
2. If the dropdown field is set as required: make sure the form does not validate if the the choice is left as "Please Choose"?
Yes, that is possible. It is set on a per-field basis, not the whole form.
Hi Chris,
I have done this all manually now for each field. Set first option to "Please Choose" enabled values and cleared that value (so its nothing). As per the post above really. I just wanted to see if there is an option to do that automatically per form. It's cumbersome if you have 12 dropdowns or more per form and they all should be configured that same way.
Anyway, it will do for now. Luckily there is the duplicate function :-)