There is a subtle bug/feature in Freeway that makes this difficult. You can set the Please choose option as your default, but if you don’t put anything in the value field, many/most browsers will interpret the resulting option:
and that means that the picker will not evaluate as empty, it will equal “something”.
What you need is to have the option come out as
<option value="">Please choose...</option>
and Freeway doesn’t do that – it collapses any empty attribute to nothing at all. I wrote an Action a number of years ago to solve this problem, it’s called SelectFix. You can apply it to the field or to the page (and it will fix all your select elements at once). Select Fix - ActionsForge
Walter
On Feb 13, 2012, at 7:25 PM, DeltaDave wrote:
Add the Please Choose option to your list and set it as the default.
I haven’t tried this specific combination, but try applying SelectFix to the select list along with Validate. Set the first option to have the label ‘Please choose…’ but the value set to nothing. All the other options in the list, set their label and value to the same, so your result code looks like this (once SelectFix has “fixed” it):
Now also apply the Validate Action to that field. As long as the two get along with one another (and that’s the only part of this I haven’t tested) the form should attempt to submit a field that equals nothing (empty string) rather than Please choose… and thus the Validate Action should throw a hissy fit as it’s supposed to.
Walter
On Feb 14, 2012, at 5:04 AM, Sly wrote:
Thanks to you both.
I am using the Validate action on the list but if the selection is left as ‘Please choose’ validate doesn’t warn the user.
What is the correct way to use this Action for a list?
Make sure that the default selection of your menu/list is;
Choice: Please choose…
Value:
(no value)
Apply the Validate Action to the menu/list item
in the Actions palette make sure the default value setting is empty (cleared)
Now when you try and submit the form you should see an alert that tells you the menu has no value.
For bonus points you can choose to add any value you like in steps 3 and 5 and as long as they match you should be fine.
Regards,
Tim.
On 14 Feb 2012, at 15:45, Walter Lee Davis wrote:
Now also apply the Validate Action to that field. As long as the two get along with one another (and that’s the only part of this I haven’t tested) the form should attempt to submit a field that equals nothing (empty string) rather than Please choose… and thus the Validate Action should throw a hissy fit as it’s supposed to.
Can anyone help with this now that I have version 6? Do not think Walt’s Form Fix will help and I have a drop down menu that I do not want my visitor to be able to skip over.
Form Fix does not have any means of making a field mandatory – all it does is fix the layout of a form element in Freeway 5.6 or lower (6 includes the same CSS that this Action writes in the application core – it’s not needed in 6 at all.
There is a form validation suite Action in the Forge – give that a try for making form elements mandatory. Normally, a picking list will not need this treatment, because there’s always one value chosen or another. The only exception is if you have a blank value (Please choose…) as your first option. Unfortunately, there’s a bug in Freeway which prevents you from making a form element that has a blank value. Even if you leave the value field blank, the form will submit with the value in the Name field. (I’ll file a bug on this.)
Walter
On Nov 9, 2013, at 7:34 PM, Hoffkids wrote:
Can anyone help with this now that I have version 6? Do not think Walt’s Form Fix will help and I have a drop down menu that I do not want my visitor to be able to skip over.
Sorry, I was remembering the wrong Action here. Yes, this Action should make it possible to set up a form element with an empty value and have it perform correctly. However, I have never tested this Action in conjunction with the form validation suite. Please give it a try and let me know how it goes. It’s not listed as being compatible with FW6, but I can’t think of any good reason why it wouldn’t work.
(Just tried it out – works perfectly on an HTML5 page in Freeway 6.)
Walter
On Nov 9, 2013, at 8:53 PM, Walter Lee Davis wrote:
Form Fix does not have any means of making a field mandatory – all it does is fix the layout of a form element in Freeway 5.6 or lower (6 includes the same CSS that this Action writes in the application core – it’s not needed in 6 at all.
Please make a new blank page with nothing on it besides one picker and the submit button. Apply FormFix to the page and validation suite to the picker. You have a lot of other JavaScript on this page, and I am not able to figure out why it isn’t working. I do see that it is having trouble figuring out the form input.
Walter
On Nov 9, 2013, at 9:27 PM, Hoffkids wrote:
Then I tried again and when I did choose something that message still showed up that nothing was chosen- it was like the opposite effect.