1
votes

Ok, so here's my code for submitting the form:

document.forms['formid'].submit();

The Form Target attribute is deprecated for the DocType I'm using -

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd

and I really don't want to use a different DocType as a work around for something so simple - so what are my options for submitting to a new window?

1
Come join us in the free and easy world of HTML5! - Pointy

1 Answers

1
votes

If you're talking about doing this from JavaScript (and the title of the question definitely makes it seem like you are), then you should be able to set the "target" attribute from your code. The W3C police won't arrest you, because your page will still validate. Once it's parsed into a DOM representation, the doctype is not very relevant (except in so far as it affects quirks mode etc).

document.forms['formid'].target = 'http://whatever.com';
document.forms['formid'].submit();