Expand my Community achievements bar.

How to link a radio button to another field ?

Avatar

Level 1

Hi,

I would like make a field required, if the "yes" value is select, but if the "no" value is select the field is optional. I look in the palet binding, but I have not found.

I found this function: form_fields_required(), but there isn't information...


Can you help me ?

thank you for your help.

Bye

2 Replies

Avatar

Former Community Member

There are a variety of ways of doing this. This is one method. In the attached form I have a radio button group called 'required' that contains 'Yes' (1) and 'No' (0). There is a text field called 'acctNumber' also. On the exit event of 'acctNumber' I check if 'acctNumber' is null. If it is, I then check if 'required' has been set to 'Yes'. If it is set to 'Yes' I then put up an alert box with a message indicating 'acctNumber' is required.

// form1.page1.subform1.acctNumber::exit - (JavaScript, client)

if (this.rawValue == "" || this.isNull) {

          if (form1.page1.subform1.required.rawValue == 1) {

                    xfa.host.messageBox("Account number is a required field.","Account Number");

          }

}

If you intend to submit the form (via email or to a server via HTTP, for example) and you need to validate the required fields are filled, additional scripting will be required on the submit button.

Steve

FYI. For form related questions, post to the LiveCycle ES Designer forum. That forum is watched very closely.

Avatar

Level 1

Thank you very much, I solved my problem.