To place a text box at a specified position

admin

Administrator
Staff member
Hi,

I want to make a text box visible based on a select box values.Right now I am able to do that.but i want the text box to appear at position where the select box appears, it means to say that i want to replace the select box with text box in that position.

I have sample code

<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">

</head>
<body>
<form name="frm">
<select id="svalue" name="svalue" onchange="javascript:test();">
<option value=http://www.webdeveloper.com/forum/archive/index.php/"1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="other">other</option>
</select>
<input type="text" name="t1" style="visibility: hidden"/>
<br>
<br>





</form>
</body>
<script>

function test()
{

//alert(document.frm.svalue.options[document.frm.svalue.selectedIndex].value);
if (document.frm.svalue.options[document.frm.svalue.selectedIndex].value=="other")
{
document.frm.t1.style.visibility="visible";
}
else
{

document.frm.t1.style.visibility="hidden";


}



}



</script>

</html>
 
Back
Top