PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
Try this:
if(event.value) //The validation is made only when something is entered...
{
percent = event.value.indexOf("%") != -1;
dollar = event.value.indexOf("$") != -1;
if (!percent && !dollar)
{
app.alert("Please include a $ sign or % sign with your numerals.")
// Add this, it will prevent from having an invalid value in the field:
event.rc = false;
app.beep()
}
else if(percent && dollar) //To check if the two are not present in the same
value
{
app.alert("Please specify with only a $ sign OR a % sign with your
numerals.",1,0);
event.rc = false;
app.beep();
}
}
As for the second part, I suggest you use the same "indexOf()" method...
Eric
>>> [EMAIL PROTECTED] 16/07/03 08h42 >>>
PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
I want to check that field to ensure that they remember to include a "$" or a "%" sign
so that the person viewing the completed form knows whether the number is a dollar
amount or a percentage
I attempted using field validation with the following code. Can anyone take a look at
this and offer a suggestion as to what I am doing wrong?
Additionally, I have a script that checks all the fields when a submit button is
pushed. I would like to have this script also check for the existence of a $ or % and
require that either one be entered if it is missing.
I want to do this in case the user clicks off the field validtion alert without adding
the missing $ or % symbol.
How can I modify the portion of script below so that it reequires the use of a $ or %
sysmbol?
else if (f8.value == "")
{app.alert ('Please enter a coop amount. If 0, please type
zero or none.');
if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
// Version specific operation:
f8.setFocus();}
Thanks in advance for any help you can give
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html