Copy value from field to another field. Example copy value mailing address to permanent address.

The javascript below using at checkbox element with value 1. Event = onchange.
var tick = this.getValue();
 
if (tick == '1') {
  $('same_as_above___permanent_address').value = $('same_as_above___current_address').getValue();
  $('same_as_above___postcode2').value = $('same_as_above___postcode1').getValue();
  $('same_as_above___city_town2').value = $('same_as_above___city_town1').getValue();
  $('same_as_above___state2').value = $('same_as_above___state1').getValue();
}
 
if (tick != '1') {
  $('same_as_above___permanent_address').value = '';
  $('same_as_above___postcode2').value = '';
  $('same_as_above___city_town2').value = '';
  $('same_as_above___state2').value = '';
}

Details