dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: Target attribute in dropdown menu

  1. #1
    Join Date
    May 2005
    Posts
    6

    Target attribute in dropdown menu

    Senario:
    Dropdown menu containting URLs.
    <OPTION VALUE="http://anyold.url" target='_blank'>Item Name

    Question:
    How do I effect the target"_blank" attribute causing the url to open in a new window from the dropdown menu?

    Ultimately, I'd like to dispense with the "Go/Submit" button and have the selection execute to a new window on mousedown.

  2. #2
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    You can't do it that way. You'll have to use an onchange handler, which will make it impossible for users without Javascript to navigate your site.

  3. #3
    Join Date
    May 2005
    Posts
    6
    Quote Originally Posted by ray326
    You can't do it that way. You'll have to use an onchange handler, which will make it impossible for users without Javascript to navigate your site.
    Hmm... OK. After some research on the above quote I think I have a grip on what you mean.

    What about..........
    With the current script & form I'm using, I don't even have "right button menu", with the option to open in a new window.
    Is that possible or does that fall under the same that you describe above?

    (Thank you, VERY much for your help.)

  4. #4
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Opening in a new window isn't a problem. Generating the navigation process is. You can't activate links directly from a select box without Javascript intervention. The supporting Javascript is just a new window creation with the desired URL.

  5. #5
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    You can open a new page from a selection list by using a server side script instead of Javascript provided that the form has a submit button. You can even combine the Javascript and server side options so that the submit button only needs to appear when Javascript is not available.

  6. #6
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    What do you send from the server to cause a new window to open with that page?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles