I have a JSFiddle that seems like it should work but it doesn’t.
function copyform(curnum){
if(curnum == 3) $('p').html('Thank You!')
var num = $('form').length;
var newNum = new Number(num + 1);
// create the new element via clone(), and manipulate its ID using newNum value
var newElem = $('#form'+curnum).clone().attr('id', 'form' + newNum);
//
//this is where I need to update the onclick to copyform('+newNum+')
$('#form'+newNum+' input').attr('onclick', 'copyform('+newNum+')');
// insert the new element after the last "duplicatable" input field
$('form').after(newElem);
}
I just need help implementing the onclick function. This is part of a larger more complex program that would be a hard example to show. Any and all help is much appreciated!
I transformed your function a bit:
http://jsfiddle.net/yjAeS/3/