ahussain
08-20-2007, 10:59 PM
Hi,
I am very new to javascript. I tried to hide row on changing dropdown select
value. Please correct me where I am mistaking. Any hint will be highly appreciated my code is:-
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript">
function showHide(type){
if(type == 'code'){
document.getElementById('trText').style.display = 'block';
else{
document.getElementById('trText').style.display = 'none';
}
}
</script>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<p> </p>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td><select name="select" onchange="showHide(this.Value)">
<option value="0">abc</option>
<option value="1">def</option>
</select></td>
</tr>
<tr id="trText" style="display:none ">
<td><input type="text" name="textfield" /></td>
</tr>
</table>
<p> </p>
</form>
</body>
Note: The error I am receieving is object is expected. Kindly correct me where exactly im mistaking..
I am very new to javascript. I tried to hide row on changing dropdown select
value. Please correct me where I am mistaking. Any hint will be highly appreciated my code is:-
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript">
function showHide(type){
if(type == 'code'){
document.getElementById('trText').style.display = 'block';
else{
document.getElementById('trText').style.display = 'none';
}
}
</script>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<p> </p>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td><select name="select" onchange="showHide(this.Value)">
<option value="0">abc</option>
<option value="1">def</option>
</select></td>
</tr>
<tr id="trText" style="display:none ">
<td><input type="text" name="textfield" /></td>
</tr>
</table>
<p> </p>
</form>
</body>
Note: The error I am receieving is object is expected. Kindly correct me where exactly im mistaking..