If these tools helped, register a free host by clicking to this banner.

Free Website Hosting

4/04/2010

Jquery double or triple dropdown list

Here you can create a double or trple AJAX listbox:
AJAX listbox


15 megjegyzés:

  1. Thanks a lot for this wonderful generator . I am surprised to see there are no comments for this and not many people viewed it . I am lucky to be the first guy to respond to this video . THANKS A LOT

    I have few questions

    1) I made this for Country , State and City . But when I select the Country I want state and for the first state all the cities to be populated . Just for country change , I want State and for the first state all the cities to be displayed . I called the state change function even when the Country changed , but that didn't do the trick.

    2) While loading is there any way I can choose the default values for Country, State and City . I mean when I hit the page , I want country to be selected by default 'India' and state "Delhi" and city "North Delhi" . Is there any way for this .


    THANKS A LOT AGAIN FOR YOUR HELP .

    VálaszTörlés
  2. Thank you Khammam for the response :) The problem with the 3 listboxes that the first and the second are in connection only, not the third and the first. I have a solution for that which is storing the first selected value in session. But it is quite complicated, the good news is that i'm planning a next generation generator for chained listboxes.

    VálaszTörlés
  3. What a immediate response . Thanks for your answer . I am trying to customize the generated code for my purpose ..May be if you have any solutions for customizing my cases , please advise .. I am trying .. let me see

    VálaszTörlés
  4. I am able to populate City also based on country selection , below is the code. Pending part is , loading default country,default state and default city.

    I am trying to paste the code I did , but it is not allowing sorry for that ..

    VálaszTörlés
  5. could you send to my email please: djjjozsi@gmail.com , thanks.

    VálaszTörlés
  6. Hi , If I change jquery.js to the current jquery version which is jquery-1.5.1.min.js . The JSON call is not working . Could you please help me on that ?

    VálaszTörlés
  7. You should try not the mini version from Jquery.

    VálaszTörlés
  8. Thanks for your quick response . Other than the Jquery file your provided , mini or development version both are not working :)

    VálaszTörlés
  9. I added .error(function() { alert("error"); }) after the getJson call and see it is throwing error . So for latest JQUERY, JSON the result format we are sending it from select.php needs to be changed looks like .. Not sure ..

    VálaszTörlés
  10. I am able to resolve the issue by changing below code in select.php . This is working great for new JQUERY version

    if (mysql_num_rows($res) > 0) {
    while ($a = mysql_fetch_assoc($res))
    $data[] = array(
    'optionValue' => $a[$id],
    'optionDisplay' => $a[$field]
    );

    return json_encode($data);
    }

    VálaszTörlés
  11. i will re-write the generator according with this code.

    VálaszTörlés
  12. Wonderful code.. Thank you.. Have a question: In three level list, imagine you select from first, then second and it populates 3rd level. It is ok. But when we changed 1st level, it only clear the second level but third level stands alive. How we can correct this?

    VálaszTörlés