i want to be able to dynamically set different text boxes depending on
the button pressed.
i was hoping obj() can "become" object "aaa" or "bbb", but it's not
working.
function clearBox(inputo bject) {
var obj=(inputobjec t);
document.main.o jb().value="hel lo";
document.main.a aa.focus();
}
----------------
<form name="main">
<input type="text" value="aaa" name="boxaaa">
<input type="text" value="bbb" name="boxbbb">
<input type="button" value="clickme" onclick="clearB ox(aaa)">
<input type="button" value="clickme" onclick="clearB ox(bbb)">
</form>
the button pressed.
i was hoping obj() can "become" object "aaa" or "bbb", but it's not
working.
function clearBox(inputo bject) {
var obj=(inputobjec t);
document.main.o jb().value="hel lo";
document.main.a aa.focus();
}
----------------
<form name="main">
<input type="text" value="aaa" name="boxaaa">
<input type="text" value="bbb" name="boxbbb">
<input type="button" value="clickme" onclick="clearB ox(aaa)">
<input type="button" value="clickme" onclick="clearB ox(bbb)">
</form>
Comment