Expand my Community achievements bar.

Mandatory is checked when exiting radio groups, but not text fields?

Avatar

Level 2

I have a form with many questions, and most all of them are required.   When tabbing out or otherwise exiting a radio group, the user gets warned if they did not select an item.  When tabbing out of a text field, nothing happens.  The user does get warned about the empty text fields if they try to submit the form.

3 Replies

Avatar

Level 6

Are you validating data via scripting?  Sounds like you may need to add validation (check to see if text field is null) on the Exit event for the text fields.

Avatar

Level 2

No, I'm just setting the mandatory property to "error".   Is there a way to get the mandatory property to fire in the exit event?

Avatar

Level 6

The following is a very basic/general script used to check/test if a field's value is null after the user exits out of the field. Note that it will not prevent the user from submitting the form, however, it seems you are covering that "validation" via other means (i.e. field property).

if (this.rawValue == null){

xfa.host.messageBox("Please enter a value in this field. It can't be left empty", "REQUIRED", 0, 0);

}

else{

}