Hello folks,
If I have the following dropdown list items:
And I want to enforce the user to select one of them except the "SELECT" item, how can I do that?
I've chekced out the User Entered - Requiered feature but it didn't help me at all - always paint my DDL border in red, when any item was selected.
Thank you,
Yair
Views
Replies
Total Likes
Hi
My guess is that you want the box to display 'select' in order for users to know to select from the box.
Therefore in the preOpen event enter something like
if (this.rawValue == null) {
this.rawValue = "Select";
}
Remove the 'select' drop down that you originally entered to avoid confusion. Make sure that the default in the Value tab is also set to 'none'.
Hope this helps.
Views
Replies
Total Likes
No, I want to tell the user to select a gender if he left the drop down list with the SELECT selected.
Yair
Views
Replies
Total Likes
Where on the form do you want this validation? Is it on a separate button?
Views
Replies
Total Likes
I want to treat the SELECT item as not selected and to tell the user that he need to select a gender.
The validation should be on the Form Submit event
Message was edited by: Yair-Nevet
Views
Replies
Total Likes
Hi, I don't believe that you need a validation script at all. Delete the "Select" from the items in the Object > Field palette. Then in Patterns dialog set up a null pattern with "Select". This way when the dropdown is null it will display "Select", no script required. Niall
Views
Replies
Total Likes
How do you want to validate that box then - when they click a button / send
email/when they click in the drop down?
The easy thing you could do is to automatically set the default to either a
male or female.
Views
Replies
Total Likes
Hi Niall,
All what I want to do is to check if the user select a gender, if he didn't, I want to tell him to select one.
What should I do?
Thank you,
Yair
Views
Replies
Total Likes
Hi Yair,
Here is an example: http://www.assuredynamics.com/index.php/category/portfolio/scripting-a-null-display-pattern-for-a-dr...
It does require script in the docReady event of the dropdown.
Hope that helps,
Niall
Views
Replies
Total Likes
Good morning Niall,
I'm using the script that you sent me yesterday.
It works O.K except the fact that if the user didn't select a gender - no error or red border comes up on the form submit event.
Maybe the resolveNode isn't work?
how should I find my object(Gender dropdownlist) hierarchy path?
How can I get some indication from the resolveNode function that the node was find?
Thank you very much and have a good day,
Yair
Views
Replies
Total Likes
Hi Yair,
The hierarchy is a palette that you use a lot. Also it is important that you name pages and objects as you create them, as it makes it much easier to reference in script. This is how you build up a full reference:
So if you amend the script to reflect your hierarchy then it should work. For example if the dropdown is in other subforms, you would need to include these in the reference, in the correct order.
When debugging a form, it is useful to open the JavaScript Console (press Control+J). If there are errors in the script as you interact with the form, they should show up in the console.
Hope that helps,
Niall
Views
Replies
Total Likes
Thank you very much Niall,
Your help assited me well.
There is what to study of you!
Views
Replies
Total Likes