O
OAM
Hi,
Why this code work with IE and not with FF
1- add an input
2- enter a value
3 -add a second input
With FF, the value is lost, not avec IE !
Thanks
Olivier.
----------
<html>
<head>
<script type="text/javascript">
var indice_sensor=0;
function add_sensor() {
indice_sensor=indice_sensor+1;
if (indice_sensor == 1)
document.getElementById('add_sensor').innerHTML=
indice_sensor+": <input type='text'
name='Sensor_Name["+indice_sensor+"]' id='Sensor_Name"+indice_sensor+"'/><br
/>";
else
document.getElementById('add_sensor').innerHTML=
document.getElementById('add_sensor').innerHTML
+indice_sensor+": <input type='text'
name='Sensor_Name["+indice_sensor+"]' id='Sensor_Name"+indice_sensor+"'/><br
/>";
}
</script>
</head>
<body>
<form>
<div>
<span id='add_sensor'></span>
</div>
</form>
<a href="#" onClick="javascript:add_sensor()">Click</a>
</body>
Why this code work with IE and not with FF
1- add an input
2- enter a value
3 -add a second input
With FF, the value is lost, not avec IE !
Thanks
Olivier.
----------
<html>
<head>
<script type="text/javascript">
var indice_sensor=0;
function add_sensor() {
indice_sensor=indice_sensor+1;
if (indice_sensor == 1)
document.getElementById('add_sensor').innerHTML=
indice_sensor+": <input type='text'
name='Sensor_Name["+indice_sensor+"]' id='Sensor_Name"+indice_sensor+"'/><br
/>";
else
document.getElementById('add_sensor').innerHTML=
document.getElementById('add_sensor').innerHTML
+indice_sensor+": <input type='text'
name='Sensor_Name["+indice_sensor+"]' id='Sensor_Name"+indice_sensor+"'/><br
/>";
}
</script>
</head>
<body>
<form>
<div>
<span id='add_sensor'></span>
</div>
</form>
<a href="#" onClick="javascript:add_sensor()">Click</a>
</body>