I am using the follow patern for a numeric field to display a percent number: num{zzzz9.999'%'}
What kind of pattern or script I can use so the field does not allow user to enter percents more than 100%?
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Not sure what the problem might be but maybe you can try something like;
if ($ <> null and ($ < 0 or $ > 100)) then
xfa.host.messageBox("More than 100%. Please change the percent.")
xfa.host.setFocus($.name)
endif
Views
Replies
Total Likes
You could add some code in the change event of the field like;
var
newValue = parseInt(xfa.event.newText);
if
(isNaN(newValue) || newValue < 0 || newValue > 100)
xfa.event.change
= "";
But this means that if they enter a number like 99 and want to change it to a number like 91 they will have to delete the second nine before they can type the 1.
Bruce
Views
Replies
Total Likes
I try to use this script on exit without any luck...
What can be wrong?
Thanks
if (form1.Page1.NumericField1.rawValue <=100) then
// good
$.rawValue = $.rawValue;
else
xfa.host.messageBox("More than 100%. Please change the percent.");
xfa.host.setFocus($.name);
endif
Views
Replies
Total Likes
Hi,
Not sure what the problem might be but maybe you can try something like;
if ($ <> null and ($ < 0 or $ > 100)) then
xfa.host.messageBox("More than 100%. Please change the percent.")
xfa.host.setFocus($.name)
endif
Views
Replies
Total Likes