views:

172

answers:

3

What is target="_new"? Validator is raising an error..

How do you do this with jquery because Validator is raising an error.

On the same page, I have target="_new" and target="_blank". target="_new" is in that form code which i received from email newsletter company.

I'm using this for target="_blank"

$(function() {
    $('a[href^=http]').click( function() {
        window.open(this.href);
        return false;
    });
});

What should i do for target="_new"

Update: 1 min Ago

upon clicking on submit button i want to open a page in new window to pass validation how to do this in jquery as i'm doing for other external link.

update:

this is code

<form method="post" class="form-wrapper" action="http://sitename.com/form.php"&gt;
+9  A: 

There is no such thing as target="_new". Using this will simply open the link in a new window called "_new". You might notice that clicking on a link with target="_new" will open a new window (or tab) but then a second link will open in the same window (or tab), rather than opening a second one as you'd probably expect.

Personally, I don't think you should be specifying target="_blank" at all - let the user choose.

Dean Harding
A: 

This is an attribute for a(anchor) tag, which let you open the page on the same window or in a new window.

hallie
+3  A: 

target="_blank" is invalid in XHTML (actually, the entire target attribute is invalid). If you want a link to open in a new window (usually a bad idea, in my opinion) and validation is important to you, the only way to do it is with javascript (like you did).

eman