I have several text fields in an Acrobat form that are set to accept numbers and are required fields. I have some users that need to enter 0 (zero) into these fields. The problem I am having is that when they do, the submit button does not recognized the 0 as input and therefore blocks the user from submitting the form. If the user then goes back to those fields and re-enters those 0s, the form will usually submit. (I say usually because I haven't tested every scenario.)
Any idea what is going on???
As a side note, I also have a script on the submit button that iterates through the required fields to check for empty fields. If they are empty, their name is pushed into an array and this array of field names is displayed in an alert box. Empty fields are defined as those registering a value of "" (text fields) or "Off" (radios and checkboxes). I've noticed that even after I add 0 to these text fields a second time, the value checker script still shows their value as registering empty. Is 0 recognized as a NULL or empty value?
Thanks,
Justin
As far as your code, depending on how you check the field, it could be treating 0 as false. So if you were to do something like this:
if(field.value) {
// This is non-empty
}
else {
// This is empty
}
and the value was 0, it would go into the "This is empty" part. If instead you did:
if(field.valueAsString) {
// This is non-empty
}
else {
// This is empty
}
and the value was 0, it would go into the "This is non-empty" part.
So maybe you are doing something like that. I would have to see your code to tell you for sure.
Thanks,
Jim Healy
FormRouter, Inc.
Check out our Free AcroForms Toolbar
http://www.formrouter.com/tools
Jim Healy, Founder & CEO FormRouter Inc.
Chapter Leader AUG RTP NC
http://www.formrouter.com