Forum Moderators: open
Since the target attribute is not allowed in XHTML 1.0 strict I'm wondering how one can direct the results of a Form submit to a new window instead of "self". Consider the follwing
<form id="Login" action="someurl" onsubmit = "window.open('someurl', 'newwin')" target = "newwin" method="post" enctype="multipart/form-data">
How can one rewrite this in XHTML 1.0 strict?
Many thanks!
And use a javascript function to open the window:
<script type="text/javascript">
function myFunc(){
input_name = document.getElementById('name').value;
input_blah = document.getElementById('blah').value;
window.open("somescript.cgi?name="+input_name+"&blah="+input_blah,"newwindow")}
</script>
<form onsubmit="myFunc()">
<input type="text" id="name" />
<input type="text" id="blah" />
</form>
target because Strict does not allow the use of frames, hence, no need for the target attribute. But, if you really need to use target, why not use a different DTD?
Anyway, the cgi was just an example .. I don't know what your url is, or the file type .. but you need to apss the arguments to the file either way, and yes .. if you're doing it through a script, there's no way to do it without the ? .. so it'll be using GET instead of POST.
Thanks again.