Click to See Complete Forum and Search --> : Can someone please help me?


Tasmanian Devil
03-29-2003, 08:11 AM
Hello yall,
I was just wondering if it is possible in a form, that a button not only submits the form but also can close the window? If someone can help that would be great.
Thanks yall
Tasmanian Devil

Jona
03-29-2003, 08:30 AM
<input type=button onclick="this.form.submit(); self.close()" value="Submit">

Or...

<input type=submit onclick="self.close()" value="Submit">

Tasmanian Devil
04-22-2003, 03:47 PM
Dear Jona~
I tired your methods, and neither one worked, the form was not sent and the window did close. Can you explain why?
Thanks
Tasmanian Devil

Jona
04-22-2003, 03:51 PM
It works in IE6. Are you sure that didn't work? It works for me.

Tasmanian Devil
04-22-2003, 04:01 PM
I just found out that I have IE5, is there a way it will work in the older bowsers and in netscape also? People that are viewing my website are using from 4-5 and netscape mostly

Jona
04-22-2003, 04:07 PM
We could try something like this....

<html><head>
<script>
function exit(){var leave = setTimeout("adios()", 1000);}
function adios(){window.close();}
</script>
</head><body>
<form action="">
<!--etc. form stuff-->
<input type=submit onclick="exit()">
</body></html>

Jona
04-22-2003, 04:08 PM
Oh, it could also be done this way (I think):

<html><head>
<script>
function exit(){var leave = setTimeout("window.close()", 1000);}
</script>
</head><body>
<form action="">
<!--etc. form stuff-->
<input type=submit onclick="exit()">
</body></html>