File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Passing values between PHP pages without navigation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Passing values between PHP pages without navigation" Watch "Passing values between PHP pages without navigation" New topic

Passing values between PHP pages without navigation

Maya Naga
Ranch Hand

Joined: Nov 09, 2009
Posts: 79
Hi all...
As i am new to php, i have the following doubt.
Say for an example, i have homepage form with few textfields and radio buttons. i have assigned method='get' where am passing values to another page . My doubt is am going to include a combo box with items such as Ravi, Devi, etc. when the user selects any item, it want to load relevant numbers (ravi->3456, devi->6789,5534) into the textfield. i have developed a code to retrieve the value but the form's method value should be 'POST'. i know it is not possible to use both get and post method at the same time. but how can i solve this problem. is it possible to send the selected item value to another page and retrieve the numbers '3456','6789' without navigating to another page.
my sample code for combo box:

i have included it into my homepage as follows: it works successfully but problem is , when i enter other textfields and select this combo value it automatically refreshes the other fields and fields become empty.

any ideas. please some one guide me some sample codes on how to do it.
David Newton

Joined: Sep 29, 2008
Posts: 12617

I don't understand what the issue is.
mahesh shinde
Ranch Hand

Joined: Jul 24, 2009
Posts: 69

I think you want to fill textbox from dropdownlist.
means if you select some value from DropDownlList ,your textbox get filled with some value .

Maya Naga
Ranch Hand

Joined: Nov 09, 2009
Posts: 79
Name Number
-------- -----------
ravi 5678
devi 8907
sam 2323,4567

say for an example the billing_numbers table will contain data similar as above. in my homepage i'll list the combobox with the name values which is retrieved using query. when the user selects 'ravi' from combobox i need to pass '5678' to the textfield value. this is what i did. since we cannot do this in single page, is it possible to retrieve the value '5678' from another php page where the query result exists without navigating to that page.

am i clear now?
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Use Ajax to make a call to the server to get the value.

I agree. Here's the link:
subject: Passing values between PHP pages without navigation
It's not a secret anymore!