Click to See Complete Forum and Search --> : textbox input
COLDASBEER
09-17-2003, 12:19 PM
I have a text box and when someone enters a code (text) into it I would like js to add a X at the end of the submitted coded
i.e. entered value : 123
submitted value: 123x
any help would be appreciated
:)
Hi,
here's a solution about that:
(or use in a function)
<form name="form1" action="" method="post" enctype="text/plain">
<input type=text name="test" onblur="javascript:var content=document.form1.test.value;document.form1.test.value=content+'X';">
</form>
requestcode
09-17-2003, 12:50 PM
or:
<form name="form1" action="" method="post" enctype="text/plain">
<input type=text name="test" onblur="document.form1.test.value=document.form1.test.value+'X';">
</form>
COLDASBEER
09-17-2003, 12:56 PM
Thanks for the quick reply!!!
Charles
09-17-2003, 03:07 PM
Or, more simply:
<input type="text" onchange="this.value = this.value + 'X'">