Click to See Complete Forum and Search --> : script for populating a text field.....


paingold
01-07-2003, 09:41 PM
Hi, first time posting here. I'm in a real bind.

I have a text field that needs to prepopulate another textfield via hitting the "tab" key.
For example-- in one text field a user could type in "10" (as in $10), another text field on the page would then populate to "12" (as in $12).
Since this is for a demo the user would be given an inital value to type in the first field. I would then have another number prepopulate into the second field regardless of what the user typed in the first field.

I know this is possible since I already had the code for this. I've lost my file that contained this JavaScript.

Any help would be much appreciated.

Thank you.

Zach Elfers
01-07-2003, 09:52 PM
<form name="formName">
<input type="text" name="textField1" onBlur="document.formName.textField2.value=this.value;">
<input type="text" name="textField2">
</form>





That should work.

paingold
01-07-2003, 10:57 PM
I owe you a beer. thanks!