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 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    Toronto, Canada
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    form question .. please help !

    Am having a bit of a problem, here it is ..

    i have a form where users fill in the information ... one of them is a pull-down menu where they can select category .. this is where my problem starts, i would like to have another pull-down menu appear as soon as they make a selection from the first pull-down menu ( like a sub_category)

    am having a peoblem with combining javascript and php together. The values for the second pull-down menu should be taken from the database .

    anyone can offer some help ...

    thanx in advance ...

    i hope i didn't confuse anyone

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    If you want to do this without a page refresh then you are going to have to load all the possible datasets for the second menu into a javascript array and then use javascript to display the pertinent results, what you can not do (without a refresh) is call the database for the second set of results at the client side.

    You could BTW utilise a hidden frame - set an onclick action to your 1st dropdown to a form in the hidden frame which grabs the data from the DB and then updates the second dropdown in the main frame but thats a pain in the bum to get working smoothly
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    Toronto, Canada
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well .. see ... i have got the javascript for the double pull-down menu working without a problem, but this is static. I would like to do it dynamicaly. This is where my problem starts. Am not sure how to get everything together ... meaning php and javascript so they work. For me is not a problem if the page refreshes or not ... eather way as long as it works

    Am fairly new to php and mysql that's why this is such a chalenge for me .... but i guess i have to start somewhere

    thanx again

  • #4
    New Coder
    Join Date
    Aug 2002
    Location
    Toronto, Canada
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how would i go about doing this menu with page refresh ?

    HormonX


  •  

    Posting Permissions

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