Link to home
Start Free TrialLog in
Avatar of mattjankowski
mattjankowski

asked on

Need Advice: Easiest implementation of popup form using 'standard' javascript/jquery

I am experimenting with Web Development. I am trying to implement two web-pages, page1 and page2.

I want to:
Enter data1 on page1
Click a button on page1 that sends data1 to page2 and opens page2 in a dialog
Enter data2 on page2
Click a button on page2 whereupon page2 processes data1 and data2 and then returns a result to page1.

Would someone be able to point me to a resource or show some example html, javascript, jquery code to get this done? I am still learning and prefer to stick to the standard libraries for the time being.

Thanks,
Matt
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

We need a little more information. Are you processing the data on the server, or is this just a clientside widget?

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.

If you give us more detailed requirements we should be able to give you more help.

Cd&
Avatar of mattjankowski
mattjankowski

ASKER

I am using the Spring MVC platform. The data processing will occur on the server. Page2 is intended to build a string. So I think that means it needs to be javascript.

returnString = Hello x, my name is y!

Page2 is where the user will be able to enter x and y with the string returned back to the submitting page. If x = top and y = cat then returnString = Hello top, my name is cat!

 I want to implement it as a page because I don't know how many strings the user will need to enter until they select a template on page1. So, if the template has 2 strings that need user input then the dialog form needs to have two entry boxes, if there are three user input string then there will be 3 entry boxes and so on. I guess Page2 needs to be javascript and probably will need to talk to the server.
Amending my previous comment, page2 will be a Java Server Page (jsp).
I don't see the need for the extra page. You can modify the container to add additional elements as needed.

If you are not saving anything on the server until the end the a single page makes senses.  If you need to go to the server along the way you can just use an AJAX call and stay a popup element on page one.

It has been along time since I did any java, I am all PHP server side.  However I don't thin a jsp page would have any problem responding to intermediate request coming via ajax.

Cd&
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just what I needed! Thank you!