Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Location
    India
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,450
    Thanks
    23
    Thanked 631 Times in 630 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •