Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Select radio button fills in series of fields

Avatar

Level 7

Here is the script I am trying. when the user select one of three radio buttons , then the set of fields are filled in or left blank for the user to fill in based on the case below. I'm getting a script error "syntax error" and nothing is filling in.

 

switch (thisrawValue) {

 

case "1":

page1.publishingChoices.publisher.rawValue = "";
page1.publishingChoices.author.rawValue = "";
page1.publishingChoices.discount.rawValue = "";
page1.publishingChoices.numComputers.rawValue = "3";
page1.publishingChoices.copyPaste.rawValue = "30%";
page1.publishingChoices.printLimit.rawValue = "30%";
page1.publishingChoices.terrDistrib.rawValue = "Global";
page1.publishingChoices.deskCopy.rawValue = "";
page1.publishingChoices.trialEligible.rawValue = "";
page1.publishingChoices.ownerRental.rawValue = "";

break;

case "2":

page1.publishingChoices.publisher.rawValue = "";
page1.publishingChoices.author.rawValue = "";
page1.publishingChoices.discount.rawValue = "";
page1.publishingChoices.numComputers.rawValue = "3";
page1.publishingChoices.copyPaste.rawValue = "50%";
page1.publishingChoices.printLimit.rawValue = "50%";
page1.publishingChoices.terrDistrib.rawValue = "Global";
page1.publishingChoices.deskCopy.rawValue = "";
page1.publishingChoices.trialEligible.rawValue = "";
page1.publishingChoices.ownerRental.rawValue = "";

break;

case "3":

page1.publishingChoices.publisher.rawValue = "";
page1.publishingChoices.author.rawValue = "";
page1.publishingChoices.discount.rawValue = "";
page1.publishingChoices.numComputers.rawValue = "";
page1.publishingChoices.copyPaste.rawValue = "";
page1.publishingChoices.printLimit.rawValue = "99%";
page1.publishingChoices.terrDistrib.rawValue = "Global";
page1.publishingChoices.deskCopy.rawValue = "";
page1.publishingChoices.trialEligible.rawValue = "";
page1.publishingChoices.ownerRental.rawValue = "";

break;

}

Thanks

MDawn

1 Accepted Solution

Avatar

Correct answer by
Level 10

In the switch statement, you need to put this.rawValue.. The dot is missing.

Did you change the language to JavaScript for this?

Thanks

Srini

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

In the switch statement, you need to put this.rawValue.. The dot is missing.

Did you change the language to JavaScript for this?

Thanks

Srini

Avatar

Level 7

The dot was it. Thank you! I had changed to JavaScript.

Margaret Dawn

630-850-1065