form results in new window (strictly speaking) |
form results in new window (strictly speaking) |
jimlongo |
Oct 2 2006, 12:20 PM
Post
#1
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
I use this code to put a Google search on some pages
HTML <form method=GET action="http://www.google.com/search" target="_blank"> <div><input type=hidden name=ie value=iso-8859-1></div> <div><input type=hidden name=oe value=iso-8859-1></div> <table><tr><td> <a href="http://www.google.com/"> <img src="http://www.google.com/logos/Logo_40wht.gif" alt="Google"></a> </td> <td> <input type=text name=q size=31 maxlength=255 value=""> <input type=submit name=btnG VALUE="Google Search"> <input type=hidden name=domains value="domain.com"><br> <input type=radio name=sitesearch value="domain.com" checked> domain.com<img src="images/spacer.gif" height="1" width="15" alt=""> <input type=radio name=sitesearch value=""> www<br> </td></tr></table> </form> I want to remove the target="_blank" from there but still have it open in another window. this is the javascript I normally use to open a link in a new window . . . CODE <a href="http://www.someplace.com" onclick="java script:openWin('http://www.someplace.com'); return false"> Is there a way to combine this to make the search results open in a new window when I'm using a STRICT DOCTYPE? Thanks, jim |
Christian J |
Oct 2 2006, 01:47 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
Since one of the points of HTML Strict is to disallow the TARGET attribute, why try to circumvent it?
If you still want to do it, you might "cheat" by inserting a TARGET attribute in the FORM element with javascript (that way the validator will not notice). Or you might open a javascript popup window with an URL consisting of the FORM's ACTION attribute and a query string put together by the form fields' name/value pairs. |
jimlongo |
Oct 2 2006, 02:08 PM
Post
#3
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
Since one of the points of HTML Strict is to disallow the TARGET attribute, why try to circumvent it? I didn't take the fact that this attribute was deprecated to mean that the practice of opening a new window was somehow verboten. As a user, I prefer that whenever a link is going to take me to another site that a new window be opened. I guess opinions may differ in this area. But as a designer I definitely don't want a link to ever close the window with my site in it. |
Darin McGrew |
Oct 2 2006, 02:57 PM
Post
#4
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
As a user, I prefer that whenever a link is going to take me to another site that a new window be opened. I guess opinions may differ in this area. As a web user, I sometimes want to open links in the same window, and sometimes want to open links in new windows. I find it easiest when the web author leaves the decision up to me, so I can click or Shift-click or Ctrl-Shift-click as desired.But as a designer I definitely don't want a link to ever close the window with my site in it. That's good. The windowing system provides multiple standard ways to close windows. The user should be familiar with at least one of them. |
Lo-Fi Version | Time is now: 28th April 2024 - 04:23 AM |