Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1588 How can I force the usee to enter data in a text filed if they tab out of an empty text field?

irt.org | Knowledge Base | JavaScript | Form | Q1588 [ previous next ]

Q1588 How can I force the usee to enter data in a text filed if they tab out of an empty text field?

Try:

<form>
<input type="text" onBlur="if (this.value == '') { alert('Please enter something'); setTimeout('this.focus()',1); }">
<input type="text" onBlur="if (this.value == '') { alert('Please enter something'); setTimeout('this.focus()',1); }">
<input type="text" onBlur="if (this.value == '') { alert('Please enter something'); setTimeout('this.focus()',1); }">
<input type="text" onBlur="if (this.value == '') { alert('Please enter something'); setTimeout('this.focus()',1); }">
<input type="text" onBlur="if (this.value == '') { alert('Please enter something'); setTimeout('this.focus()',1); }">
<input type="text" onBlur="if (this.value == '') { alert('Please enter something'); setTimeout('this.focus()',1); }">
</form>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.