I have a Drop down list which allows custom entry.
There any way if the user starts to type a new item into DD a message should pop up" Please something...."?
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
If you do not want the message to fire when the user selects from the drop-down, the change event below is as close as you are going to get I think. However, the message box doesn't fire until the user enters the first character.
I have a drop-down called 'stooges' that allow custom entry and contains the list items 'Larry', 'Curly', and 'Moe'.
// form1.page1.subform1.stooges::change - (JavaScript, client)
if (xfa.event.newText != "Larry" && xfa.event.newText != "Curly" && xfa.event.newText != "Moe") {
xfa.host.messageBox("Are you sure it is not Larry, Curly, or Moe?");
}
Steve
Views
Replies
Total Likes
If you do not want the message to fire when the user selects from the drop-down, the change event below is as close as you are going to get I think. However, the message box doesn't fire until the user enters the first character.
I have a drop-down called 'stooges' that allow custom entry and contains the list items 'Larry', 'Curly', and 'Moe'.
// form1.page1.subform1.stooges::change - (JavaScript, client)
if (xfa.event.newText != "Larry" && xfa.event.newText != "Curly" && xfa.event.newText != "Moe") {
xfa.host.messageBox("Are you sure it is not Larry, Curly, or Moe?");
}
Steve
Views
Replies
Total Likes
Thanks Steve for your help, it's work fine!
Just one more question: In my case to apply your script was easy(I have only 5 items into DD).
What about if the DD contains a lot of Items, what kind of script we have to apply?
Thanks Steve
Views
Replies
Total Likes
This is a bit of hack...but it works.
// form1.page1.subform1.stooges::change - (JavaScript, client)
var itemCnt = form1.page1.subform1.stooges.length;
var matchFound = false;
for (var i=0; i < itemCnt; i++) {
if (xfa.event.newText == form1.page1.subform1.stooges.getDisplayItem(i)) {
matchFound = true;
}
}
if (matchFound == false) {
xfa.host.messageBox("Are you sure it is not Larry, Curly, or Moe?");
}
Views
Replies
Total Likes
Thank you again for all your help Steve!
When I try to type a new item into DD the message repet itself again and again for every character I type...
Thanks
Views
Replies
Total Likes
Move the code from Change event to Exit event of the DD List.
Thanks
Srini
Views
Likes
Replies
Views
Likes
Replies