Expand my Community achievements bar.

Validation to prevent form submission

Avatar

Level 1

Livecycle seems to be able to provide a warning/error message when validation fails for a particular field, however it still allows the form to be submitted. E.g. a user can enter 'sdfhsdfh' into a date field, OK the validation error message and still submit the form.

Is there anyway to prevent form submission until the validation error is corrected?

3 Replies

Avatar

Level 4

The Date/Time field, and for that matter all fields, do not have any validation set on them automatically. The only difference in each field is the tag associated with its name (TextField, NumericField, DateField) and then any extra controls it may offer, like the Calendar picker for the date field. If you want to set a validation on the field that will restrict any additional characters you do not want. So to use your example, go to the date field and in the Object tab select the Value Tab. Click the "Validation Pattern" and then add in "date.default{}", or the first option at the top and hit ok. This will only allow a date to be entered into this cell. This is also not allow the form to be submitted until the field meets the validation you have set. Now this will allow any date format so if you want a specific date you can set the the "Display Pattern" to change it to whatever you want.

Avatar

Level 1

Hi Josh

I wish it were that simple.

I have a form that has validation set on the date field similar to the way that you describe (date{DD/MM/YY}) . I can add completely random text into this date field and then hit tab. I then get a warning that my date is invalid, so I click 'OK'. However, I then hit my submit button and the invalid date is still sitting in the date field, yet the form submits successfully.

Have you any idea why my form still submits successfully despite the invalid date?

Avatar

Level 10

Hi,

check this article. It describes how to prevent printing/submitting when a validation fails.

http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in-acrobat-8/