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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Keep selection of drop down from menu

    Hi guys,

    OK.

    Im just working on a enquiry form submission script. When the form is submitted a php scripts checks for empty fields etc. If a empty field is found the for comes back and a error messages is displayed.

    When the forms re-appears the fields which werent filled out correctly before stay filled in, simply putting setting the fields 'value' with the $_post variables.

    Now this is ok but is there a way so if the users selects a choice from my drop menu the first time that this choice remains when the form re-appears if something else was found to be invalid ??

    Hope I explained that ok ??

    This is the form here if you want to look.

    http://www.turbobounce.com/contact/feedform.php


  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Couple of options... first is to use sessions (this is what I'd recommend).

    Second is store form info in a table, flagging the info as "temporary".

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since your process_email.php form posts to itself for validation, you could just easily replace the method you use to output the select box with a small php routine that will flag whichever one was selected on the form entry as selected


  •  

    Posting Permissions

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