First of all, sorry for my English!!!
I want to display or not a text field (named other_category) depending
on the value of text field named exercise_category. If last's value is
"other" then the "other_category" field should be displayed. The
following script is placed in the page.
<script language="javascript">
function onchange(){
var x=document.getElementById("exercise_category");
var y=document.getElementById("other_category");
var value=x.options[x.selectedIndex].value;
if (value=="other"){
y.style.display="";
}
else {
y.style.display="none";
}
}
</script>
The "exercise_category" field is generated dynamically from a
database.The following code is where the field is generated and the
call on Javascript is happening.
<div align="center">
<table width="80%" border="1">
<tr>
<th scope="row"><div align="left">Êáôçãïñßá
Üóêçóçò </div></th>
<th scope="row"><select name="exercise_category"
id="exercise_category" onChange="onchange();"><?php
require_once('bookmark_fns.php');
session_start();
$db_conn = db_connect();
$query = "select distinct exercise_category from exercise";
$result = mysql_query($query, $db_conn);
while ($row=mysql_fetch_array($result)){
$exercise_category=stripslashes($row['exercise_category']);
$display_block.="<option value=\"$exercise_category\">
$exercise_category</option>";
}
$display_block.="<option value=\"other\"¶ëëç</option>";
echo $display_block;
?>
</select></th>
</tr>
<tr>
<th scope="row"><div align="left">ÍÝá
êáôçãïñßá Üóêçóçò </div></th>
<th scope="row"><input name="other_category"
type="text" id="other_category" maxlength="30" style="display: none">
</th>
</tr>
There is no problem in Firefox, when i choose other the
"other_category" text field is displayed. But in IE stack overflow is
happening when there is a call on Javascript.
Please help!!!!!!!!!!!!!!!!!!!!!!
Hello from beautiful Greece!!!!!!!!!!!!!