New Forum | Previous | Next | (P-PDF) Beginners
Topic: Reset button doesn't clear all fields
Conf: (P-PDF) Beginners, Msg: 126988
Date: 2/3/2005 06:12 AM
I'm working on a form and added some java script to format certain fields. I then added a validation rule to ensure that the fields are completed correctly. I'm new to this, so my methods are probably not the best, however they work. The problem I'm having is that when I click my reset button to reset the form, the validation messages appear and the fields are not cleared.
Here are the two scenarios I'm using.
Force phone number to include area code:
I entered the following into the Custom Format Script:
event.value = util.printx("(999)-999-9999", event.value) ;
That worked for formatting but didn't force the user to put in all the numbers, so I added this script under the "Validate" tab in Custom Validate Script:
app.alert("Enter 10-digit phone number beginning with area code (e.g., (916) 456-8910)");
My 2nd scenario is for military time. I want the time in 4 digits, no colon. For this one I placed the following in the custom keystroke script:
AFNumber_Keystroke(0, 0, 0, 0, "", false)
I used the same validate script above but the length was 4 and the message was different.
Is there a better way to do this?
When I click the reset button to reset the form it resets all fields except for these. Additionally, all the validate messages pop up.
I have also tried adding a document script: AFNumber_Keystroke(0, 0, 0, 0, "", false)
This also brings up the validate messages and does not clear the fields.
Thanks for your help.