Skip navigation
Currently Being Moderated

Error message when hiding an empty required field

Jul 31, 2012 1:53 PM

Tags: #script #field #javascript #dynamic #hidden #livecycle_es2 #subform #livecycle_designer

I have a yes/no radio button in a seperate subform

In that subform i have an other subform that is hidden on "no" and is visible on yes

A field in the second subform is required when visible and not required when hidden

When hidden, the value is also reset to ""

 

I've put an calculation script on the first subform to do all this (also tried to put it on layout:ready)

 

if (button.rawValue == 1){
     subform.presence = "visible";
     subform.field.validate.nullTest = "error";
}
else{
     subform.presence = "hidden";
     subform.field.validate.nulltest = "disabled";
     subform.field.rawValue = "";
}

 

But when i switch between yes and no, and the second subform hides again.

Then i get an error message that the field cannot be empty.

 

Is there a way to avoid this message?

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points