Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Best use of a N/A radio button in conjunction with radio button groups.

Avatar

Level 1

Hello,

I am really new to LiveCycle ES, I'd be too embarassed to tell you how I stumbled into this app.  I am attaching a screen shot of a survey question as designed by our sales team.  Ideally they want me to formulate the question responses in such a way that the N/A response, if selected by the user, disallows other radio buttons from being selected on the same line.  I have built each group to be an exclusionary group so that under each category, only one response is allowed.  The problem is that the N/A option is its own radio group and cannot be deselected.

Does anyone have advice on how to handle an N/A radio button option or can suggest a totally alternative method to handle this.  Its best if you look at the screen shot to see how hokey this truly is.

Thanks,

Julie

1 Accepted Solution

Avatar

Correct answer by
Level 10

Julie,

You copied my script but did not change the path names to the form variables. My form root was 'form1'. Your form root is 'SupplierSurvey'.

Additionally, two form variable naming conventions rules: do not use dots (.) and do not use hyphens (-).

I renamed 'Page4-SurveyStart' to 'Page4_SurveyStart' and removed the '.1' extension from the radio button exclusion groups in section 1.1. As a result the code works for section 1.1 and you will have to make the applicable changes to the other sections.

Steve

View solution in original post

0 Replies
This widget could not be displayed.

Avatar

Level 10

Avatar

Level 10

I commonly use a checkbox that is formatted as a circle. It looks like a radio button but you can toggle it on/off. In the attached form I created an exclusion radio button group called 'bestCustomerComparison'. If you toggle 'notApplicable' on, it resets the exclusion group and makes the group 'readOnly'. If you toggle 'notApplicable' off, you can select a radio button in the group.

// form1.page1.subform1.notApplicable::change - (JavaScript, client)

if (this.rawValue == "1") {

     xfa.host.resetData("form1.page1.subform1.bestCustomerComparison");

     form1.page1.subform1.bestCustomerComparison.access = "readOnly";

}

     else {

          if (this.rawValue == "0") {

               form1.page1.subform1.bestCustomerComparison.access = "";

          }

}

Steve

I commonly use a checkbox that is formatted as a circle. It looks like a radio button but you can toggle it on/off. In the attached form I created an exclusion radio button group called 'bestCustomerComparison'. If you toggle 'notApplicable' on, it resets the exclusion group and makes the group 'readOnly'. If you toggle 'notApplicable' off, you can select a radio button in the group.

// form1.page1.subform1.notApplicable::change - (JavaScript, client)

if (this.rawValue == "1") {

     xfa.host.resetData("form1.page1.subform1.bestCustomerComparison");

     form1.page1.subform1.bestCustomerComparison.access = "readOnly";

}

     else {

          if (this.rawValue == "0") {

               form1.page1.subform1.bestCustomerComparison.access = "";

          }

}

Steve

Avatar

Level 1

Avatar

Level 1

Getting closer still.  I think I got all of the correct code added, except still a hiccup with the checkbox.  When I activate it to On status, it does not hold.  It immediately goes back to off status.

Getting closer still.  I think I got all of the correct code added, except still a hiccup with the checkbox.  When I activate it to On status, it does not hold.  It immediately goes back to off status.

Avatar

Level 10

Avatar

Level 10

Julie,

If you can post the form (or send it to me directly through the forum email) I would be happy to take a look.

Steve

Julie,

If you can post the form (or send it to me directly through the forum email) I would be happy to take a look.

Steve

Avatar

Level 1

Avatar

Level 1

Here it is all its glory...yikes.  I found I had this application ten days ago and so what you are seeing is my first ever use.  I am sure it could be a lot cleaner. 

To help navigate, page 4 subform called One.One is where I attempted to implement the code. 

Here it is all its glory...yikes.  I found I had this application ten days ago and so what you are seeing is my first ever use.  I am sure it could be a lot cleaner. 

To help navigate, page 4 subform called One.One is where I attempted to implement the code. 

Avatar

Correct answer by
Level 10

Avatar

Correct answer by
Level 10

Julie,

You copied my script but did not change the path names to the form variables. My form root was 'form1'. Your form root is 'SupplierSurvey'.

Additionally, two form variable naming conventions rules: do not use dots (.) and do not use hyphens (-).

I renamed 'Page4-SurveyStart' to 'Page4_SurveyStart' and removed the '.1' extension from the radio button exclusion groups in section 1.1. As a result the code works for section 1.1 and you will have to make the applicable changes to the other sections.

Steve

Julie,

You copied my script but did not change the path names to the form variables. My form root was 'form1'. Your form root is 'SupplierSurvey'.

Additionally, two form variable naming conventions rules: do not use dots (.) and do not use hyphens (-).

I renamed 'Page4-SurveyStart' to 'Page4_SurveyStart' and removed the '.1' extension from the radio button exclusion groups in section 1.1. As a result the code works for section 1.1 and you will have to make the applicable changes to the other sections.

Steve

Avatar

Level 1

Avatar

Level 1

Its a thing of beauty, (at least that section is!).  Thanks for all your help it is most appreciated.

Its a thing of beauty, (at least that section is!).  Thanks for all your help it is most appreciated.