If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Interactive Dropdown Populate

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-13-11, 08:19
graphix graphix is offline
Registered User
 
Join Date: May 2011
Posts: 1
Interactive Dropdown Populate

Hi all,

I am a newbie to php & mysql. Can someone help me with the code to perform this task...

I have a table with few fields... Lets say A, B, C, D & E...

Now I want to display all these fields as a radio buttons. When someone selects "C" in radio button, the dropdown next to it must populate with all records of field "C" sorting alphabetically.

I don't know how to populate dropdown dynamically as per the choice user makes in radio button...

After that, user selects a particular item on dropdown menu. On clicking submit button the result.php must be generated by filter as shown...

Select * From <tablename> Where "C"="selection from dropdown"

I hope my query is well described. Step-by-step guide would be appreciated.

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 05-13-11, 10:32
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
I think you will need to have a look at Ajax in javascript. These allow you to get information remotely but you will need to use more javascript to empty and then populate the dropbox. The Ajax call will interact with the PHP code which then talks with the database. I suggest you raise this in the PHP or javascript forum.

Here is an example of Ajax in action: errno

You add in the errno value and it will search in the database for the corresponding text without ever moving from the web page. The javascript takes the returning text, empties the results area and then applies the returned text string in the results area.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On