Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set the value of a field if lost focus in another field? 1

Status
Not open for further replies.

wvdba

IS-IT--Management
Jun 3, 2008
465
US
Hi,
i have two input boxes, box1 and box2. i want to put a value in box2 if box1 loses focus. i'm not very familiar with field functions in js. any suggestions?
thanks.
 
Something like this should work:

Code:
<input id="box1" value="whatever" onblur="document.getElementById('box2').value = 'Oooh mammy!';" />

<input id="box2" value="" />

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
thank you.
it did the trick
cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top