G
geradeaus
Hello,
I was wondering if I could do the following : can I change the formname and
fieldname with an argument? This way I can re-use the script multiple times.
My code (that doesn't work):
-----------------
<script>
function test(arg,arg2) {
document.arg.arg2.value="yes";
}
</script>
<form name="frmtest">
<input type="text" name="test1" value="hello">
<input type="button" onclick="javascript:test('frmtest','test1');">
</form>
I was wondering if I could do the following : can I change the formname and
fieldname with an argument? This way I can re-use the script multiple times.
My code (that doesn't work):
-----------------
<script>
function test(arg,arg2) {
document.arg.arg2.value="yes";
}
</script>
<form name="frmtest">
<input type="text" name="test1" value="hello">
<input type="button" onclick="javascript:test('frmtest','test1');">
</form>