PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________

I have a PDF form with several fields. In one of the fields, a user must enter a 
number, either a percentage or a dollar amount.

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, however it does not work 
correctly. Can anyone take a look at this and offer a suggestion as to what I am doing 
wrong?

var re = /^[$]\d$/
if (re.test(event.value) == false)   {

app.alert("Please include a $ sign or % sign with your numerals.")

app.beep()

} 

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

Reply via email to