How to link a radio button to another field ?

Avatar

Avatar
Boost 1
Level 1
jordano2117
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
jordano2117
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
jordano2117
Level 1

10-10-2011

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

198 likes

Total Posts

1,435 posts

Correct reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

198 likes

Total Posts

1,435 posts

Correct reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
Steve_L_Walker
Level 9

11-10-2011

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

Avatar
Boost 1
Level 1
jordano2117
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
jordano2117
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
jordano2117
Level 1

12-10-2011

Thank you very much, I solved my problem.