Hi Guys,
I want to write a javascript which does following:
Please see HTML code>
When page is loaded first time:
Clone User Text field and it button “Add and Clone” should be dislabed.
When user clicks on Checkbox First Name and Last Name should be disabled and Clone User and Add and Clone should be enables.
Thanks
<html>
<head>
<title></title>
<style>
</style>
<script language=”javascript”>
</script>
</head>
<Script type=”text/javascript”>
function toggle(chk) {
if (this.checked)
alert(“Checked”);
else
alert(“Not Checked.”)
}
</Script>
<body>
<form>
<input type=”checkbox” name=”option1″ value=”name” id=”check” onClick=”toggle(‘option1’)”>
<!–div id=”toggle” style=”display: none;” –>
<tr >
<td><br>
First name:
</td>
<td>
<input type=”text” name=”firstname” id=”firstname”>
</td>
</tr>
<!–/div–>
<tr>
<td><br>
Last name:
</td>
<td>
<input type=”text” name=”lastname” id=”lastname”>
</td>
<td>
<input type=”button” name=”adduser” Value = “Add User” id=”adduser”>
</td>
</tr>
<tr>
<td><br>
Clone User
</td>
<td>
<input type=”text” name=”clone” id=”clone”>
</td>
<td>
<input type=”button” name=”addandClone” Value = “Add And Clone” id=”clonebtn”>
</td>
</tr>
</form>
</body>
</html>