Results 1 to 2 of 2

Thread: Two dynamic listboxes using AJAX, PHP and MySql updating a textbox

  1. #1
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Two dynamic listboxes using AJAX, PHP and MySql updating a textbox

    i'm a newbie with MySql, AJAX and PHP and i need help to guide me in the right direction

    i need to make a quote form that uses two dropdown listboxes and a text box
    to access a database with two tables... table and zonerate. the fields are

    MySql Database name is web_data containing tables:

    TABLE ..........id - code - key - text
    id should be used as a filter id=ZN
    text contains city and zone names
    code contains the zone code for that city or zone

    ZONERATE.....zone1 - zone2 - price
    zone1 and zone2 contain the same code used in the above TABLE.code field

    i need to populate both listboxes with zone names from TABLE then
    after selecting a zone in LISTBOX1.. the pickup zone ....store the value from code in a variable $pzone and
    after selecting a zone in LISTBOX2..the drop off zone ..store the value from code in a variable $dzone?


    from here i need to use Variables $pzone and $dzone to match the vatues in table ZONERATE fields zone1 and zone2 to find the value in field price and if a value exists display it in TEXTBOX



    I would be grateful for any and all help
    Last edited by johntigner; 01-11-2008 at 11:22 AM.

  2. #2
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You may want to take a look at this PHP Forms Generation and Validation class.

    It comes with a plug-in that can do exactly what you want: link select inputs retrieving options from a database on the server via AJAX when the previous input changes its value.

    Here is a live example of a form with linked select inputs that uses this plug-in.

    Here you may also watch a tutorial video about the linked select plug-in.

Bookmarks

Posting Permissions

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