Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-02-2012, 02:11 AM   PM User | #1
master3w
New to the CF scene

 
Join Date: Dec 2012
Location: India
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
master3w is an unknown quantity at this point
fetch information from a database with AJAX

I want to fetch information from a database with AJAX with two select box
like example
http://www.w3schools.com/php/php_ajax_database.asp but that contain
only one select box I want to do it using two select box when two select box select MySQL table will display as w3 example please help me to edit it for my need
master3w is offline   Reply With Quote
Old 12-02-2012, 11:14 AM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 362 Times in 361 Posts
sunfighter is on a distinguished road
In the example, your sending the value of the drop down with onchange="showUser(this.value)"
Simple add a second parameter to identify the dropdown that is sending a value:
onchange="showUser(this.value, 'first')"
Use onchange="showUser(this.value, 'second')" for the other dropdown.

In the JS code have an IF statement to check IF both dropdowns have a value and than send your query.
sunfighter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:37 AM.


Advertisement
Log in to turn off these ads.