how to change all those properties while pressing the relevent button.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
function change() {
for (var i=0;i<arguments.length;i=i+2) arguments[i].value = arguments[i+1];
}
</script>
</head>
<body>
<form name="myForm">
Insert: <input type="text" name="insert">
<br>Update: <input type="text" name="update">
<br>Delete: <input type="text" name="sdelete">
<br>Select: <input type="text" name="select">
<br><input type="button" value="Change" onclick="
var a=document.forms['myForm'];
change(a.insert,'new insert',
a.update,'new update',
a.sdelete,'new delete',
a.select,'new select')">
</form>
</body>
</html>
The function change() is as follows:
Every 1st argument is the element you want to apply to new text to, every 2nd argument is the text to be applied to the previous element, using the .value attribute.
Bookmarks