Magic Icon Clearing Individual Fields (via focus): Magic JavaScript

Quick Jump ↵

Usage

Add data-mjf="clear_onfocus" id="FIELD_ID" to your <input> or <textarea> tag.

Add <script type="text/javascript">$m.wand.clear_onfocus = true;</script> inside your <body> tag.

Example


This field will clear when focused. If the value hasn't changed when blurred, the default value will be restored.



Notes

Using this will disable Form Validation.

« Back to the main documentation