Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q1288 When clicking on another window or frame, a form fields onChange event handler is not triggered, is there a way to detect changes?

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

Try using the onBlur event handler to check the current value of the form with a value captured using the onFocus event handler for the form field:

<input type="text" onFocus="window.temp=this.value" onBlur="if (window.temp != this.value) alert('Changed')" onChange="alert('Changed')">

However, if used normally both events will trigger the alert.

©2018 Martin Webb