Skip to content

Instantly share code, notes, and snippets.

@full-stack-king
Forked from tnorthcutt/gformscopyaddress.js
Created January 7, 2016 16:04
Show Gist options
  • Save full-stack-king/de82e4b71f04a3daf317 to your computer and use it in GitHub Desktop.
Save full-stack-king/de82e4b71f04a3daf317 to your computer and use it in GitHub Desktop.
Autofill a set of fields (in a gravity form, in this case) based on a checkbox being checked.
jQuery(document).ready(function($) {
$('input#choice_13_1').click(function() {
if($(this).is(':checked')) {
$('#input_2_12_1').val($('#input_2_2_1').val());
$('#input_2_12_2').val($('#input_2_2_2').val());
$('#input_2_12_3').val($('#input_2_2_3').val());
$('#input_2_12_4').val($('#input_2_2_4').val());
$('#input_2_12_5').val($('#input_2_2_5').val());
};
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment