Magic Icon Copying Fields from One to Another: Magic JavaScript

Quick Jump ↵

Basic Usage

Add data-mjf="copy_fields" data-mjf_cf_on="click(OR)change(OR)focus(OR)etc" data-mjf_cf_slaves="SLAVE_GROUP" to the field that has the value to copy from (master).

Add data-mjf_cf_slave="SLAVE_ID" to the field to copy to (slave).

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

Examples

when changing the first. To trigger the change, you must click outside of the field.

when typing in the first.

when typing in the first.

when focusing the first.

when changing the drop down.

to this when clicking the checkbox.

Copy from this to this

Copy from this to this and this

Copy from this to only this ... or to only this

Notes

Add data-mjf_cf_only_empty="true" to the "copy to" field if you only want to the copy to happen if the "copy to" field is blank.

Look at the example code to see how they work and for other ideas and possibilities.

« Back to the main documentation