Click to See Complete Forum and Search --> : Data handling
achat
04-04-2003, 06:33 AM
Is it possible to return a particular value from a sub page to the calling page.
I will expalin. I have a page say page1 which has a text box , there is a hyper link next to it to another page say page2. In page 2 i will query the database on certain parameters given by the user and return a value or set of values. The user can choose the desired value from the result and page2 should return this value to the textbox of page1 on pressing the submit button.
Vladdy
04-04-2003, 11:29 AM
Why can not you have page1 do the query as well so it reloads with the new data in the textbox :confused:
Calmaris
04-04-2003, 04:03 PM
I've tried doing that as well with hyperlinks but i don't think there is a way to pass the data from page to page using hyperlinks, plz tell i'm wrong or i've created more work then needed. But use submit buttons, works great for me.
achat
04-04-2003, 10:07 PM
Vladdy ,
The situation is like this. My page1 runs a query based on the inputs given there but consider a situation where the input is say a vendorcode, i cant expect the user to remember the code. He might know only the name, so i use another page to let the user type the name and pick up the code which is returned to page1 for further processing.
U might say y use vendorcode in page 1 y not use the name directly. The reason is that the same vendor might have been registered in different addresses with diferent vendor codes.
Maybe i am on the wrong track. How can i achieve the above result from one page.
Calmaris,
could u tell me how u have used the submit button?
Vladdy
04-07-2003, 10:09 AM
Originally posted by achat
Vladdy ,
The situation is like this. My page1 runs a query based on the inputs given there but consider a situation where the input is say a vendorcode, i cant expect the user to remember the code. He might know only the name, so i use another page to let the user type the name and pick up the code which is returned to page1 for further processing.
U might say y use vendorcode in page 1 y not use the name directly. The reason is that the same vendor might have been registered in different addresses with diferent vendor codes.
Maybe i am on the wrong track. How can i achieve the above result from one page.
Option 1 (most cross-browser). On page 1 have input for vendor name. When submited, if vendor name is present and vendor code is not, get the code from DB and add it to the code input so that page reloads with the vendor code filled.
Option 2 (won't work with popup blockers and disabled javascript). Next to vendor code input have a "Get vendor code" link that opens a popup window which allows to query the code using name. After the popup was reloaded the code can be sent to the opener page.
Option 3 (most user friendly but requires JS enabled and compliant browser). Use technique described here (http://forums.webdeveloper.com/showthread.php?s=&threadid=5810) to query database for vendor code in the background.