I want to edit the returned data from the $.get. I'm stuck on how to apply the newly created inputname, the problem I believe is with $(data).
id = '12';
$.get('/page.php?id='+id, function(data) {
// split input name by hyphen
m = $(data).find('input').attr('name').split('-');
// build new input name attribute
inputname = m[0] + '-' + id + '-' + m[2] + '-' + m[3] + '-' + m[4] + '-' + m[5];
// apply new input name to data ??? this part I'm stuck on.
$(data).find('input').attr('name', inputname);
});
data? What it should be and are you sure you are getting what you want? Log it somwhere.