Click to See Complete Forum and Search --> : Close page after submit button


mdcoll
12-23-2003, 09:14 AM
Is there a way to automatically close the web page after the user clicks the "submit" button? I have tried the following code but it seems to not work. Thanks.

<form action="mailto:email@address.com" method="post" enctype="test/plain" onSubmit="window:close();">
<p>Name:
<input type="text" name="textfield">
</p>
<p>
<input type="submit" name="Submit" value="Submit" >
<input type="reset" name="Reset" value="Reset">
</p>

</form>

fredmv
12-23-2003, 09:54 AM
<form action="mailto:email@address.com" method="post" enctype="test/plain" onsubmit="self.close();">
<div>
<label for="n" style="display: block;">
Name:
</label>
<input type="text" name="t" id="t">
<input type="submit" name="Submit" value="Submit" >
<input type="reset" name="Reset" value="Reset">
</div>
</form>

mdcoll
12-23-2003, 02:15 PM
Well, after testing the code. It looked like it worked i.e. the window closed but it ended up being buried under other windows.

Any suggestions or reasons why this might of occurred.

Thanks.