cancel
Showing results for 
Search instead for 
Did you mean: 

Validation

pbechani
Participant
0 Kudos

Hi

I have two issues that I need help on. I want to validate date and a drop down list on an offline form. For the date, the user will be forced to enter a valid date before saving. The other issue is a user should be restricted to selecting values from a drop down list and not be able to enter any custom data.

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey Prince,

What you can do for the date validation is the following:

In the date field in the form, select the Object tab and the Value tab. In the Value tab, you can choose a validation pattern that you want, say YYYY/MM/DD, then enter a message for the Validation Pattern Message or the Validation Script Message. This should give you a popup window with an error. You can also write a javascript or form calc script to do a validation on a date, or even check if the date has been entered, and after the error, you could set the focus back into the date field.

For your second issue, if I understand it correctly, you want to restrict what a user enters on a form, depending on what they select from a dropdown... I hope I'm right here... well there are two ways you can go about this. By using form calc or javascript, when the user selects a certain value from the dropdown list, in the Exit routine of the dropdown, you could set which fields you want to be read only OR you could set the fields to be invisible or hidden...


fieldname.presence = "invisible"
fieldname.presence = "hidden"
or
fieldname.access = "readOnly"

Hope this helps...

Cheers,

Kevin

Answers (1)

Answers (1)

harman_shahi
Contributor
0 Kudos

Hello,

1)

For a validation check, you can try some JavaScript as following:

if (DateField.rawValue == null){
xfa.host.messageBox("Please fill in the Date field before saving.");
}

2) There are multiple types of Dropdown lists available in Adobe forms. The ones that allows custom entries are mostly located in the u201CWebDynpro ActiveXu201D library. You can set the following option to allow\disallow a custom entry in this dropdown list:

In the Object\Field tab, check\uncheck the property u201CAllow Custom Text Entryu201D

Hope this helps,

Harman