Let me preface this by saying I'm a complete newb when it comes to front-end (and back-end, for that matter) development. Please keep that in mind. There.
So I've got a form that's a few pages long. To traverse the form all I'm doing is showing and hiding container divs. The last page is a confirmation page before submitting. It takes the contents of the form and lays it out so the user can see what he/she just filled out. If they click on one of these it'll take them back to the page they were on (#nav1~3), focus on that field, and let them type in a new value if they need to.
Using jQuery, I made variables for EVERY field/radio/check/select/textarea/whatever. If my method seems silly please pwn me but basically, and this method works ok already, but I'm trying to scale it and I don't have any idea how because I don't really know what I'm doing. Thoughts?
var field1 = '<a href="#" onclick="$(\'#nav1\').click();$(\'input#field-1\').focus();" title="Click to edit">' + $('input#field-1').val() + '</a>'; $('#field1-confirm').html(field1); var field2 = '<a href="#" onclick="$(\'#nav1\').click();$(\'input#field-2\').focus();" title="Click to edit">' + $('input#field-2').val() + '</a>'; $('#field2-confirm').html(field2);
And so on, with field3, 4, 5 ~ 25, etc.
If you could help out explaining in non-programmer terms, I'd love you forever. Thanks.