J
Joseph
I am attempting to create a function that will hide all SPANS within an ided
DIV ="idMain", then only display one span, but this function gives an error
when it gets to elChildElement as being undefined.
The show_hide_Div function is meant to be called when a Radio button is
selected. See below.
Can anyone help
function show_hide_Div(theDiv,DivsToHide,TheDivToShow) {
elDiv = document.all.theDiv;
elChildElement = elDiv.DivsToHide;
alert (elChildElement);
for (x=0; x<elChildElement.length; x++){
elChildElement[x].style.visibility = 'hidden';
}
elDiv.TheDivToShow.style.visibility = 'visible';
}
// The Radio Buttons
<form name="form1" id="form1" method="post" action="">
<label><input type="radio" name="RadioGroup" id='raidConfig'
value="IPConfig"
onClick="checkRadio(this.form.name);show_hide_Div('idMain','IPButton','spanidConfig');"
/>IP Config</label>
<label><input type="radio" name="RadioGroup" id='raiding' value="IPPing"
onClick="checkRadio(this.form.name);show_hide_Div('idMain','IPButton','spanidPing');"
/>Ping</label>
etc...
More radio buttons
....
SO when I select say the IP Config radio button I want to hide all the
others buttons that may be showing and only display the spanidConfig SPAN
which contains its own TextBox and Button,
// The Form that contains a collection of SPANS.
</form>
<DIV id='idMain'>
<span name='IPButton' id='spanidConfig'> <input type='text' id='idConfig'
value='' size='30' />
<input type='button'
onclick='DoIP_Config();show_hide_Div(='idMain','IPButton' ,'spanidConfig')
;' value=' IP Config ' />
<br></span>
<span name='IPButton' id='spanidPing'> <input type='text' id='idPing'
value='' size='30' />
<input type='button' onclick='Do_Ping();show_hide_Div(='idMain','IPButton'
,'spanidConfig') ;' value=' Ping ' />
<br></span>
<span name='IPButton' id='spanidTracert'> <input type='text' id='idTracert'
value='' size='30' />
<input type='button'
onclick='Do_Tracert();show_hide_Div(='idMain','IPButton' ,'spanidConfig') ;'
' value=' Tracert ' />
<br></span>
</DIV>
TIA
Joseph
philippeoget at hotmail dot com
http://www.geocities.com/philippeoget/a2z/
--
Hope that helps
Joseph
philippeoget at hotmail dot com
http://www.geocities.com/philippeoget/a2z/
DIV ="idMain", then only display one span, but this function gives an error
when it gets to elChildElement as being undefined.
The show_hide_Div function is meant to be called when a Radio button is
selected. See below.
Can anyone help
function show_hide_Div(theDiv,DivsToHide,TheDivToShow) {
elDiv = document.all.theDiv;
elChildElement = elDiv.DivsToHide;
alert (elChildElement);
for (x=0; x<elChildElement.length; x++){
elChildElement[x].style.visibility = 'hidden';
}
elDiv.TheDivToShow.style.visibility = 'visible';
}
// The Radio Buttons
<form name="form1" id="form1" method="post" action="">
<label><input type="radio" name="RadioGroup" id='raidConfig'
value="IPConfig"
onClick="checkRadio(this.form.name);show_hide_Div('idMain','IPButton','spanidConfig');"
/>IP Config</label>
<label><input type="radio" name="RadioGroup" id='raiding' value="IPPing"
onClick="checkRadio(this.form.name);show_hide_Div('idMain','IPButton','spanidPing');"
/>Ping</label>
etc...
More radio buttons
....
SO when I select say the IP Config radio button I want to hide all the
others buttons that may be showing and only display the spanidConfig SPAN
which contains its own TextBox and Button,
// The Form that contains a collection of SPANS.
</form>
<DIV id='idMain'>
<span name='IPButton' id='spanidConfig'> <input type='text' id='idConfig'
value='' size='30' />
<input type='button'
onclick='DoIP_Config();show_hide_Div(='idMain','IPButton' ,'spanidConfig')
;' value=' IP Config ' />
<br></span>
<span name='IPButton' id='spanidPing'> <input type='text' id='idPing'
value='' size='30' />
<input type='button' onclick='Do_Ping();show_hide_Div(='idMain','IPButton'
,'spanidConfig') ;' value=' Ping ' />
<br></span>
<span name='IPButton' id='spanidTracert'> <input type='text' id='idTracert'
value='' size='30' />
<input type='button'
onclick='Do_Tracert();show_hide_Div(='idMain','IPButton' ,'spanidConfig') ;'
' value=' Tracert ' />
<br></span>
</DIV>
TIA
Joseph
philippeoget at hotmail dot com
http://www.geocities.com/philippeoget/a2z/
--
Hope that helps
Joseph
philippeoget at hotmail dot com
http://www.geocities.com/philippeoget/a2z/