drop down list without submit button

Discussion in 'PHP' started by jacka, Jul 21, 2008.

  1. #1
    Hi

    I have a very simple question that i guess will result in a complicated answer.
    I have a mainly php page that displays a simple html country list.
    When a user chooses an item from the list I would like to use that chosen country and fetch an item from database depending on the country of choice.
    All without submitting any form.

    I expect javascript is involved.
    I have searched anywhere but can not find an answer.
    Appreciate your time.
    :confused::confused:
     
    jacka, Jul 21, 2008 IP
  2. Conquerorcs

    Conquerorcs Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well if you want to update page without submitting your information, you have to use Ajax in your application. You can handle your selection at dropdown with Javascript but you can not connect DB and update page with Javascript. So you should learn some basic concepts on Ajax.
     
    Conquerorcs, Jul 21, 2008 IP
  3. jacka

    jacka Peon

    Messages:
    165
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi
    Thanks for your reply.
    I do not want to connect to db using javascript.
    All i want javascript to do is pass on to me the chosen value in the drop down list, so that I can use it with php.
    :confused::confused:
     
    jacka, Jul 21, 2008 IP
  4. jacka

    jacka Peon

    Messages:
    165
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0