Skip to content

Instantly share code, notes, and snippets.

@konglie
Created February 24, 2017 08:44
Show Gist options
  • Save konglie/6e7404e8d1ab6a22ad96d7939a914989 to your computer and use it in GitHub Desktop.
Save konglie/6e7404e8d1ab6a22ad96d7939a914989 to your computer and use it in GitHub Desktop.
$('input[name="contactdetails[Registrant][Name]"]').parents('fieldset').find('input')
.each(function(){
var n =$(this).attr('name');
var v = $(this).val();
var a = ['Admin', 'Tech', 'Billing'];
for(var i in a ){
var s = a[i];
var sn = n.replace('Registrant', s);
$('input[name="' + sn + '"]').val(v);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment