DH
Programmer
- Dec 8, 2000
- 168
Hello,
I am using the folling code to hide or display a panel depending on which radio button has been selected.
computer selected: display panel1 hide panel2
website selected: display panel2 hide panel1
Works fine except that when the 'website' radio button is selected 'panel2' displays but it is to far down. Is there a way for it to display right higher up the page like right under the radiobutton list?
Here is the code which can be tried:
Thanks for help.
DH
I am using the folling code to hide or display a panel depending on which radio button has been selected.
computer selected: display panel1 hide panel2
website selected: display panel2 hide panel1
Works fine except that when the 'website' radio button is selected 'panel2' displays but it is to far down. Is there a way for it to display right higher up the page like right under the radiobutton list?
Here is the code which can be tried:
Code:
<HTML>
<HEAD>
<title>WebForm1</title>
<script language="JavaScript">
<!--
function showImageFrom() {
if (document.forms[0].RadioButtonList1[0].checked == true)
{
document.getElementById('Panel1').style.visibility = "visible";
document.getElementById('Panel2').style.visibility = "hidden";
document.getElementById('file1').value = "";
}
else
{
document.getElementById('Panel1').style.visibility = "hidden";
document.getElementById('Panel2').style.visibility = "visible";
document.getElementById('txtURL').value = "";
}
}
//-->
</script>
</HEAD>
<body MS_POSITIONING="FlowLayout">
<form name="Form1" method="post" action="WebForm3.aspx" id="Form1" enctype="multipart/form-data">
<input type="hidden" name="__VIEWSTATE" value="dDwtOTk4NTg2NzY0O3Q8O2w8aTwxPjs+O2w8dDxwPGw8ZW5jdHlwZTs+O2w8bXVsdGlwYXJ0L2Zvcm0tZGF0YTs+Pjs7Pjs+Pjs+GmyBKkraeMHu6tQLfwP9sbkrULU=" />
<P>
<span id="RadioButtonList1" onclick="showImageFrom();" style="font-family:Verdana;font-size:XX-Small;height:3px;width:150px;"><input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="1" checked="checked" tabindex="1" /><label for="RadioButtonList1_0">Computer </label><input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="2" tabindex="1" /><label for="RadioButtonList1_1">Website</label></span></P>
<P>
<div id="Panel1">
<input name="file1" id="file1" type="file" style="FONT-SIZE: 8pt; WIDTH: 336px; FONT-FAMILY: verdana; HEIGHT: 20px" tabIndex="2" size="36" />
<input type="submit" name="btnUpdateBrowse" value="Upload" id="btnUpdateBrowse" tabindex="4" style="font-family:Verdana;font-size:XX-Small;height:20px;" />
</div></P>
<P>
<div id="Panel2">
<input name="txtUrl" type="text" id="txtUrl" tabindex="3" style="border-color:Silver;border-width:1px;border-style:Solid;font-family:Verdana;font-size:XX-Small;height:20px;width:338px;" />
<input type="submit" name="btnUpdateUrl" value="Upload" id="btnUpdateUrl" tabindex="5" style="font-family:Verdana;font-size:XX-Small;height:20px;" />
</div></P>
<P> </P>
<script language="javascript">
<!--
showImageFrom()
//-->
</script>
</form>
</body>
</HTML>
Thanks for help.
DH