Magic Icon Form Submission (via click): Magic JavaScript

Quick Jump ↵

Usage

Add data-mjf="submit_onclick|return_false" data-mjf_soc_id="FORM_ELEMENT_ID" id="ELEMENT_ID" to your clickable tag.

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

Example



Submit the form above!

Notes

Add data-mjf_soc_name_value="NAME=VALUE" if you want to submit your clickable tag as a form field.

If you have a field element with name="submit" this will not work, you'll get a JavaScript error. This is completely from the browser and nothing we can do. Rename your field element to something else.

If you have a form tag with onsubmit="FUNCTION()" the onsubmit probably won't fire. There isn't a work-around other than to write your own MJS onsubmit handler.

If you're using, $m.wand.form_required = true; put this before $m.wand.submit_onclick = true; so the validation will work.

« Back to the main documentation