Ok, there’s surely room for improvement. For example: why did you use
$('body').on('click', 'myClass' ...) when you could simply use
Also, when hidding part of your form, you could use a better selector for turning those inputs ‘readonly’. Maybe use
$('#' +i+ ' input') or some other solution like that (I’m not being specific here, just think you can work something out in the future).