How to work dependent dropdowns and still to retain user input in a form?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bels
    New Member
    • Apr 2008
    • 3

    How to work dependent dropdowns and still to retain user input in a form?

    I am currently designing a real estate website using Dreamweaver CS3, php, MySQL on a Mac. On it is a 'property search' form that queries the property database. The form consists of 5 dropdown lists. The first dropdown (buy or let) is a parent list and the 3rd and 4th dropdowns (minimum price and maximum price) are child lists - they are dependent on what is chosen in the 1st dropdown. I have got it working with an onchange event and javascript but I am experiencing problems when it comes to retaining the information the user has put into the form. It all works fine except for when the user choose 'let' (in 1st dropdown) it's min and max prices are not retained because their values are found in the javascript.

    Is there not an easier way of doing a parent child dropdown and retaining the choice the user has made from page to page? Do I use hidden fields? I can't populate the drop downs dynamically as minimum and maximum prices are not in the database - there is just a single price for the property.

    I have attached code from my form and javascript

    Please help.

    Thanks
    Attached Files
    Last edited by Bels; Apr 9 '08, 11:17 AM. Reason: Adding code as an attatment
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    I believe there's too much code there. ma' man!

    Remember to post just the relevant code; if its a whole load of code people just arent going to read it.

    Remember code tags, also!

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      When you want to post that many code lines, store it into a separate .txt file and add that file as an attachment to your post.

      moderator

      Comment

      • Bels
        New Member
        • Apr 2008
        • 3

        #4
        Thanks for the advise. Being new to the site it is great to have feedback.

        I have added the code I am having a problem with ie the form and javascript - should I resubmit the question with an attached file or are you able to help me from here.

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          Please resubmit the question with the code file attached.

          moderator

          Comment

          • Bels
            New Member
            • Apr 2008
            • 3

            #6
            I have edited my question and added an attachment of my code.

            Hope you are able to help.

            Thanks

            Comment

            Working...