I would like to submit a form, have the response appear in a new window, be able to control the new window, and give the user the option to press enter instead of the submit button to submit the form. The following almost works, however, does not allow the new window to be controlled:
[code=html]<form action=”my_form_file.php” method=”post” target=_blank>
<input type=”submit” value=”Submit”>
<!– other forms go here –>
</form>
As an alternative, I am considering the following:
[code=html]<form id=”my_form” action=”my_form_file.php” method=”post”>
<input type=”button” value=”Submit” onclick=”submit_form();”>
<!– other forms go here –>
</form>
[CODE]function get_recipes() {
document.forms.my_form.submit();
window.open(“my_form_file.php”,””,”top=20,left=20,width-250,height=500, status, location, menubar, resizable,scrollbars,toolbar”);
}
I am having a difficult time getting this second approach working. Any suggestions? Also, this won’t allow the user to press enter to automatically submit (unless I add a bunch of javascript for each form field). Is there a better way to do this?
Thanks