DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Problem with ajax drop&down select for 3 fields

  1. #1
    Join Date
    Apr 2007

    Problem with ajax drop&down select for 3 fields

    Hi All
    I have some trouble with this script (script attached with post):
    when I choose <option>country in the first field script load info to third field?? I don't understand where the problem??
    Please, help me with this script.

    Thanka all.
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2007

    ajax drop/down list problem

    Hi Alex.
    The problem is that you define two variables (url) and (what) in the first <script>...</script> section, then you re-define them in the second <script>...</script> section, so the second definition will replace the first one because they are global variables.
    Please try this:

    var url = "";
    var what = "";
    function GetStates(Country)
    url = "country.php";
    what = "SetStates(req.responseText)";
    function SetStates(States){...}[COLOR=Sienna]

    function GetCities(State)
    url = "state.php";
    what = "SetCities(req.responseText)";
    function SetCities(Cities){...}
    Last edited by mouaffak; 04-17-2007 at 02:04 AM.

Similar Threads

  1. pl/sql stored procedure tuning
    By shiva_vaddadi in forum VB Classic
    Replies: 1
    Last Post: 06-08-2006, 09:43 AM
  2. Replies: 0
    Last Post: 09-02-2002, 07:45 AM
  3. How do I find duplicate records?
    By Nancy in forum Database
    Replies: 2
    Last Post: 01-11-2002, 10:38 PM
  4. Drop down / select problem... sooo sooo close
    By Murray Foxcroft in forum Web
    Replies: 0
    Last Post: 11-10-2000, 08:41 AM
  5. Syntax problem with SELECT statement
    By msavoy in forum Web
    Replies: 0
    Last Post: 03-24-2000, 12:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center