N
Norman
Hello,
I have a working Show / Hide form, that works on FF, but what I would
like to do is to be able to display one part when a user clicks on one
radio button and display another part when the user clicks on the
second radio button - here is the code which just shows / hides the
whole form:
<script type="text/javascript">
<!--
var dl_elements = new Array('dl_address_country',
'dl_address_region',
'dl_address_county',
'dl_address_uk_region');
function show_creation_form() {
for (i=0; i < dl_elements.length; i++) {
element_id = dl_elements;
element= document.getElementById(element_id);
element.style.visibility = 'visible';
}
}
function hide_creation_form() {
for (i=0; i < dl_elements.length; i++) {
element_id = dl_elements;
element = document.getElementById(element_id);
element.style.visibility = 'hidden';
}
}
-->
</script>
<!-- This form is for the UK only -->
<dl id="dl_address_uk_region">
<dt><label for="company_region">Region</label></dt>
<dd>
<select name="company_region">
<option value="">[Select One]</option>
<optgroup stl:repeat="region create_form/regions"
label="${region/label}">
<option stl:repeat="county region/counties"
value="${county/id}">${county/label}</option>
</optgroup>
</select>
</dd>
</dl>
<!-- This form is for the UK only -->
<!-- Non UK States, teritories or provinces form starts here -->
<dl id="dl_address_country">
<dt><label for="address_country">Country</label></dt>
<dd>
<input size="40" name="address_country" />
</dd>
</dl>
<dl id="dl_address_region">
<dt><label for="address_region">Region/State</label></dt>
<dd>
<input size="40" name="address_region" />
</dd>
</dl>
<dl id="dl_address_county">
<dt><label for="address_county">County</label></dt>
<dd>
<input size="40" name="address_county" />
</dd>
</dl>
So, what I would like is that if a User clicks on the UK - radio
button only the first part of the form is shown and hide the second
part and vice a versa, when a User clicks on Non - UK radio button the
second part of the form is show and the first is hidden.
Any advise will be much appreciated.
Many thanks
Norman
I have a working Show / Hide form, that works on FF, but what I would
like to do is to be able to display one part when a user clicks on one
radio button and display another part when the user clicks on the
second radio button - here is the code which just shows / hides the
whole form:
<script type="text/javascript">
<!--
var dl_elements = new Array('dl_address_country',
'dl_address_region',
'dl_address_county',
'dl_address_uk_region');
function show_creation_form() {
for (i=0; i < dl_elements.length; i++) {
element_id = dl_elements;
element= document.getElementById(element_id);
element.style.visibility = 'visible';
}
}
function hide_creation_form() {
for (i=0; i < dl_elements.length; i++) {
element_id = dl_elements;
element = document.getElementById(element_id);
element.style.visibility = 'hidden';
}
}
-->
</script>
<!-- This form is for the UK only -->
<dl id="dl_address_uk_region">
<dt><label for="company_region">Region</label></dt>
<dd>
<select name="company_region">
<option value="">[Select One]</option>
<optgroup stl:repeat="region create_form/regions"
label="${region/label}">
<option stl:repeat="county region/counties"
value="${county/id}">${county/label}</option>
</optgroup>
</select>
</dd>
</dl>
<!-- This form is for the UK only -->
<!-- Non UK States, teritories or provinces form starts here -->
<dl id="dl_address_country">
<dt><label for="address_country">Country</label></dt>
<dd>
<input size="40" name="address_country" />
</dd>
</dl>
<dl id="dl_address_region">
<dt><label for="address_region">Region/State</label></dt>
<dd>
<input size="40" name="address_region" />
</dd>
</dl>
<dl id="dl_address_county">
<dt><label for="address_county">County</label></dt>
<dd>
<input size="40" name="address_county" />
</dd>
</dl>
So, what I would like is that if a User clicks on the UK - radio
button only the first part of the form is shown and hide the second
part and vice a versa, when a User clicks on Non - UK radio button the
second part of the form is show and the first is hidden.
Any advise will be much appreciated.
Many thanks
Norman