Click to See Complete Forum and Search --> : text input field events
tjacobs01
September 10th, 2002, 11:37 AM
Hi all,
What event handlers work with straight <input> fields? I'd like to catch changes (hit enter or something) so I can parse the text and change some other elements on my page. Is this possible?
Waldo2k2
September 16th, 2002, 06:30 PM
<input type="text" onblur="javascript:alert('something changed')">
however, that would force validation even if the user tabbed through....may be ok for some applications (log in systems for example wehre you only have two text areas)
or
<input type="text" onchange="javascript:alert('something definetly changed')">
this is almost foolproof, however if someone just tabs over something and leaves the old information it's not caught, so it's really up to you.
good luck.
Zvona
September 17th, 2002, 05:21 AM
Simply, use onchange event.
http://www.w3.org/TR/html401/interact/forms.html#edef-INPUT
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.