Hi,
I am using the following script that makes a message box appear. The problem is that people are complaining that the message box appear multiple times and that you have to continusly click ok like 11 times for the "warning javascript window" message box to go away.
Can I use a different script or reduce the amount of times that the message box appears?
if (this.rawValue > 132) {
xfa.host.messageBox("Maximum Sick Time is 132");
this.rawValue = 132;
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
I am not sure how to do this but if this field has any dependent field using which it is calculeted, then the dependent field could be used to set the value and subsequently show the pop up message.
Views
Replies
Total Likes
Hi,
In which event does this piece of code lie in? Is it within a function, then could it be that the function gets called repeatedly ?
Regards,
Ber
Views
Replies
Total Likes
Hi Ber,
Thanks for responding.
The event is validate and the language javascript. I am not sure why the message box appears so many times. I hope we can find out why.
Thanks again!
Views
Replies
Total Likes
The validate event might cause the script to run multiple times here. You can use any other event to notify the user for the threshold value.
Please have a look at the flow.
Thanks
Views
Replies
Total Likes
Hi Wasil,
I removed the script from the validate event and now the message box comes up only once, but only if I actually click on the field. The field that has the threshold value is automatically calculated so people do not click on this field, therefore, the message box will not appear for them. In addition, the number does not automatically go to 132.
I tried putting the script in other events but the script does no funciton properly.
Which event do you recommend?
Views
Replies
Total Likes
I am not sure how to do this but if this field has any dependent field using which it is calculeted, then the dependent field could be used to set the value and subsequently show the pop up message.
Views
Replies
Total Likes
I see. What is the trigger that you want for such a validation? Is it on click of a button, or on exit of this field? If its on exit, have you tried placing the code in the 'Exit' event instead?
Views
Replies
Total Likes
Hi Wasil,
I moved the script to the dependent field and placed the following script and it worked! Now the message box only appears once. I put it in the calculate event. Thanks!
if ( topmostSubform.Page1.Text19.rawValue > 132) {
xfa.host.messageBox("Maximum Sick Time is 132");
topmostSubform.Page1.Text19.rawValue = 132;
}
Views
Replies
Total Likes
Thanks Bern87 for trying to help. I appreciate it.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies