Results 1 to 1 of 1

Thread: Dynamic Form with Dropdown Menu and Text Box

  1. #1
    Join Date
    Sep 2009
    Posts
    33
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default Dynamic Form with Dropdown Menu and Text Box

    Hi All, not sure if this is a javascript question or a form question, but I have a new project Im working on regarding a form.

    People have a drop down menu within this script or form that has three choices. Each choice needs to reference a different URL for the choice, and then go to it on Submit. Thats the easy part. The hard part is that the script/form also has a text box in it that has a zip code to be placed inside. So for example, someone chooses the first option, and puts in a zipcode within the text field and hits "submit", so when its submitted it goes to a URL + the zipcode.

    HTML Code:
    <form name="URL_TEST">
    <input type="text"/>
                        <select name="selected" id="target">
                        <option selected>Select...</option>
                        <option value="http://www.URL1.com/page?zipcode=[ZIPCODE]">WEBSITE1</option>
                        <option value="http://www.URL2.com/page?zipcode=[ZIPCODE]">WEBSITE2</option>
                        <option value="http://www.URL3.com/page?zipcode=[ZIPCODE]">WEBSITE3</option>
                        </select>
                        <input type="submit" name="submit" id="submit" value="Submit"/>
    </form>
    This is kind of a crude bit of code, I know (just took it briefly from dreamweaver), but what Im trying to do with the above is have the "input type="text"" be filled it, and connected to one of the "[ZIPCODE]" options on submit. So you can put a zipcode into the text field, choose option one, hit submit, and it will go to the URL, replacing the "ZIPCODE" area of the URL with the zipcode that was typed in. Im sure this is more complicated, but Im not sure where to start/complete/finish this. Any ideas? Thanks

    Anyone??
    Last edited by aaronrusso; 11-05-2013 at 01:16 PM.

Similar Threads

  1. Resolved Please Help - Simple Form Dropdown that Opens a Text input
    By leblanc in forum JavaScript
    Replies: 5
    Last Post: 12-23-2010, 12:55 AM
  2. Anylink JS DropDown Menu - images instead of text
    By RonSerling in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 10-28-2009, 07:21 PM
  3. Form - dropdown menu (enable/disable)
    By karimali831 in forum JavaScript
    Replies: 0
    Last Post: 09-30-2009, 12:06 PM
  4. Anylink Dropdown menu on Dynamic Ajax Content
    By jjmc_09 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 10-20-2008, 11:23 AM
  5. Dynamic-FX Slide-In Menu (v 6.5) - Replacing Text with Image
    By lauralyn in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 06-10-2008, 08:46 AM

Bookmarks

Posting Permissions

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