View Full Version : onSubmit

02-24-2003, 11:05 PM
I solved this before like 2 years ago on this forum, but I cannot find it in the archive.

here is my problem, I need a popup window to honor the window attributes onsubmit but they aren't

<form method="post" name="form1" action="http://www.iwon.com" target="myWin" onsubmit="window.open('','myWin','toolbar=no,status=no,location=no,menubar=no,scrollbars=yes,resizable=no,widt h=250,height=250');return true;">

<script language="javascript">
function forme()
{ document.form1.submit() }

<a href="#" onclick="forme()">Link</a>

I know that the attributes default to no, this is just overkill. I thought that we figured there is just a problem doing this with the submit() function, but if I use an input button I should be fine. I cannot use an input button, all help is appreciated. Thanks

Roy Sinclair
02-25-2003, 03:32 PM
Why not move the onsubmit code to your forme function?

02-26-2003, 03:07 AM
calling document.form1.submit() won't fire the onsubmit event handler. just call window.open() before that, inside your forme() function as Roy said.

02-26-2003, 05:35 PM
not sure why I didn't think of that but that worked :o