B
Ben Dover - Mental Patient 0057
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(inputobject) {
var obj=(inputobject);
document.main.ojb().value="hello";
document.main.aaa.focus();
}
----------------
<form name="main">
<input type="text" value="aaa" name="boxaaa">
<input type="text" value="bbb" name="boxbbb">
<input type="button" value="clickme" onclick="clearBox(aaa)">
<input type="button" value="clickme" onclick="clearBox(bbb)">
</form>
the button pressed.
i was hoping obj() can "become" object "aaa" or "bbb", but it's not
working.
function clearBox(inputobject) {
var obj=(inputobject);
document.main.ojb().value="hello";
document.main.aaa.focus();
}
----------------
<form name="main">
<input type="text" value="aaa" name="boxaaa">
<input type="text" value="bbb" name="boxbbb">
<input type="button" value="clickme" onclick="clearBox(aaa)">
<input type="button" value="clickme" onclick="clearBox(bbb)">
</form>