How to implement pop-up forms using JavaScript and jQuery

Posted by · September 25, 2013 9:44 am

accepted solution

This blog post is part of our Featured Solutions series. These posts highlight relevant technology solutions on Experts Exchange and the experts who took the time to provide a quality answer. For exclusive access to over 3 million technology solutions, join the Experts Exchange community for free** today! 

Sometimes the answer to your technology problem is easier than you initially thought. Such was the case when Experts Exchange member mattjankowski asked for advice on the easiest way to implement a pop-up form using standard JavaScript and jQuery.

Matt, who is new to web development, wanted to create two web pages where data could be input, processed and then returned as a result; but he needed some help getting started. Web development expert COBOLdinosaur responded to Matt’s question almost immediately and suggested that Matt might not need to code a second page at all.

“Are you processing the data on the server, or is this just a clientside widget?” COBOLdinosaur asked. “If you are going to the server for processing then I would probably want to use AJAX or an Iframe. If you are just working on the client then you don’t need a second page, you can just popup the second panel in a styled div.”

Matt explained that he was using the Spring MVC platform and processing the data on the server. COBOLdinosaur confirmed that it was not necessary for Matt to create a second page, and web development wizard padas agreed.

“No second page needed.  If you are using the Spring framework, that is designed to create endpoints to your database.  Your post would go directly to your endpoint and accept a response,” padas said.

Padas also included examples of what the code would look like in jQuery and Ajax as well as a few links to other examples that will help Matt improve his knowledge of web development.