Jump to content

getting selected value from page 2 and passing back to page1


kwstephenchan

Recommended Posts

Hi,

I have 1 php page (page 1) which has a button.

On clicking of this button, another php page (page 2) will pop up with a list of values from the database. User will select one of these values and this value will be displayed on page 1.

I know I must use ajax but don't know how. What I can do is to pass a value from page 1, through javascript (and a php which does not have user interface) get a value from the database and pass it back to page 1. What I am having trouble with is that the second page will have an interface for user to select. Just can't figure this out.

Is there any suggestion or sample code that I can study.

Thanks.

Link to comment
Share on other sites

save yourself the trouble of having page 2 pop-up.

 

Have page 2 form displayed on page 1.  If you need a inwindow pop up look form a in-window pop-up. not another actual window.

 

1 way you can do that is using <div> then picking the size, height-width-position of div window.  Then hide/show the table for when you want to use it or not.  You might even save yourself the trouble of using AJAX if you build the div window inside the FORM section.

 

Really what your trying to do is more complicated than it really has to be.  There is generally always a simpler way to do stuff.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.