179704 (2) [Avatar] Offline
I have a menu where I can select to create/persist a new form similar to the form in Ch. 11. To my menu I have added the option to edit the form. The edit menu link goes to a page that has a populated drop-down/select element populated with forms I can edit. A form is selected, onSubmit an Ajax call is made to retrieve the JSON form data.

Issue: The form data needs to return to the the Form page and not the selectAformToEdit page where the Ajax call origintated.

Solution: Move the <div> with the drop-down/select element to the form page and hide it. From the create/edit menu determine whether to display the new empty form <div> or the selectAformToEdit <div>. If editing a form, retrieve the JSON form data populate the hidden empty form, hide the selectAformToEdit <div> and show the newly populated form <div>.

Question: Is there a better pattern/solution to this scenario?

Thanks for any comments. And thanks for writing the book.
179704 (2) [Avatar] Offline
Anyone who read this and scratched their heads thanks for your time. I've muddled SOCs. At this point I have one form (pure HTML) completed in sections and a menu. Two pages. I knew when I started this project it would not be an SPA, but at best a stack of them. So I just need to add some JSTL to my page and when the page loads (blank or populated) it will still have the desired behaviors. Thanks for letting me think here.