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
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Drop down menu, launch new page

    I have a basic drop down menu with the options:
    Code:
    <option>Single Family</option>
    <option>Two Family</option>
    <option>Multi-Family</option>
    <option value="vacant.php">Vacant Land</option>
    <option>Condominium</option>
    <option value="commercial.php">Commercial</option>
    <option>Investment</option>
    As soon as someone selects 'Vacant Land' or 'Commercial', I want them to be automatically redirected to that form, without having to select a 'go' button, since these users may not be that adept. I imagine this is rather easy via Javascript, but that's not my cup of tea Any ideas?

    ...or, maybe it would be best to do this, if you guys know of a way? EssentiallyThe Site Link example, when people select vacant land or commercial; some of the areas that have bedrooms, bathrooms, garage, etc. are ilrelevant -- originally, I was going to have javascript send you to a new page when you select one of those from the drop down menu... but maybe I am not thinking this clearly? Maybe I should swap out those td's with other td's of the relevant information... can javascript do this? Or should I look at PHP or some other scripting language?
    Last edited by bradyj; 06-25-2004 at 08:08 PM.
    // Art is what you can get away with. <-- Andy Warhol
    ...:.:::: bradyjfrey.com : htmldog : ::::.:...

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    You omitted the values of the other options, making this less obvious...I'm guessing they're the same as the text string, so:
    Code:
    <select onchange="v=options[selectedIndex].value;if(/\.php$/i.test(v))self.location=v">
    <option value="">- choose -</option>
    <option value="">Single Family</option>
    <option value="">Two Family</option>
    <option value="">Multi-Family</option>
    <option value="vacant.php">Vacant Land</option>
    <option value="">Condominium</option>
    <option value="commercial.php">Commercial</option>
    <option value="">Investment</option>
    </form>

  • #3
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by adios
    You omitted the values of the other options, making this less obvious...I'm guessing they're the same as the text string, so:
    Code:
    <select onchange="v=options[selectedIndex].value;if(/\.php$/i.test(v))self.location=v">
    <option value="">- choose -</option>
    <option value="">Single Family</option>
    <option value="">Two Family</option>
    <option value="">Multi-Family</option>
    <option value="vacant.php">Vacant Land</option>
    <option value="">Condominium</option>
    <option value="commercial.php">Commercial</option>
    <option value="">Investment</option>
    </form>
    Cool, thank you -- I will test accordingly I adjusted my post, and added maybe you guys had some better ideas about how to do this?
    // Art is what you can get away with. <-- Andy Warhol
    ...:.:::: bradyjfrey.com : htmldog : ::::.:...


  •  

    Posting Permissions

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