Hi,
is there any way how to put "i" variable from "for" cycle into an input name?
It should disable the number of rows inserted into "rows" input. E.g. when number 3 is inserted, inputs row1,row2,row3 should become disabled.
How to make "document.forma.rowi.disabled = true" to work?
Thx for hints,
Ganymed
is there any way how to put "i" variable from "for" cycle into an input name?
Code:
<html>
<head>
<script>
function change_rows() {
for (var i = 1; i < document.forma.rows.value; i++) {
document.forma.rowi.disabled = true
}
}
</script>
</head>
<body>
<form name="forma">
Number of rows: <input type="text" name="rows" onChange="change_rows();"><br>
Row no.1: <input type="text" name="row1"><br>
Row no.2: <input type="text" name="row2"><br>
Row no.3: <input type="text" name="row3"><br>
Row no.4: <input type="text" name="row4"><br>
Row no.5: <input type="text" name="row5"><br>
</form>
</body>
</html>
It should disable the number of rows inserted into "rows" input. E.g. when number 3 is inserted, inputs row1,row2,row3 should become disabled.
How to make "document.forma.rowi.disabled = true" to work?
Thx for hints,
Ganymed