190
rated 0 times
[
197]
[
7]
/ answers: 1 / hits: 16080
/ 10 Years ago, sun, december 28, 2014, 12:00:00
I have write some simple code which would make input field enabled and disabled on button click but it is not responding.
please help me...!!!
<html>
<head>
<script type=text/javascript>
function toggleEnable(el1, el2) {
document.getElementByID(el1).disabled = true;
document.getElementByID(el2).disabled = true;
}
</script>
</head>
<body>
<form>
<table>
<tr>
<td><input id=input1 class=myText type=text placeholder=Row 1 /></td>
<td><input id=input2 class=myText type=text placeholder=Row 1 /></td>
<td><button onclick=toggleEnable('input1','input2')> Enable/Disable </button></td>
</tr>
<tr>
<td><input id=input3 class=myText type=text placeholder=Row 3 /></td>
<td><input id=input4 class=myText type=text placeholder=Row 4 /></td>
<td><button onclick=toggleEnable('input3','input4')> Enable/Disable </button></td>
</tr>
</table>
</form>
</body>
</html>
More From » css