Activating and Disabling templates dependant on Radio Button selections - Templates not disabling
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?