Skip to main content
Participant
June 4, 2021
Question

Activating and Disabling templates dependant on Radio Button selections - Templates not disabling

  • June 4, 2021
  • 1 reply
  • 936 views

I have a form that is made up of two cover pages and seven templates (hidden).

The cover pages have seven radio buttons (assigned Javascript) to enable one of the templates when selected. This works fine.

However, if the wrong button is selected, and the template is already enabled, if you now select another button, the new template appears but the one you first selected is still there as well.

I need to have only one template appear at a time. If another button is selected, the first template needs to be hidden again.

 

What is the Javascript for this? 

 

My script to enable my first template (3 pages) is-:

 

if (event.value != "Off") {this.getTemplate("N Lead").spawn(this.numPages, false, false) ;}
if (event.value != "Off") {this.getTemplate("n Lead cont").spawn(this.numPages, false, false) ;}
if (event.value != "Off") {this.getTemplate("Member Ack and Sub").spawn(this.numPages, false, false) ;}

 

My script to enable my second template (2 pages) is-:

 

if (event.value != "Off") {this.getTemplate("Key Staff").spawn(this.numPages, false, false) ;}
if (event.value != "Off") {this.getTemplate("Member Ack and Sub").spawn(this.numPages, false, false) ;}

 

If I enabled the first one and then decided to enable the second one instead, what is the script to go into the second one to make the first template hidden again?

 

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
June 4, 2021

You can delete the spawned pages.

Participant
June 4, 2021

Wow! Thats helpful Bernd. Thanks for taking the time...

Participant
June 6, 2021

However, this does not provide the answer, being I ask for the javascript, not a comment on what to do...