Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Form | Q1588 [ previous next ]

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>

©2018 Martin Webb