Submit button to also close popup form

N

Neil

Is there a way to close a popup form using the same submit button, rather
than the form loosing control to the submit destination?

Or can a submit button send my form to a URL of my choice?

suggestions appreciated.
 
M

Moneypenny

You can make a little javascript function who close the popup in 2 seconds
afther the submit.

like:

<form action="blaat.php" onSubmit="close_window()">
........
</form>
 
N

Neil

Thanks for the reply

I'm not real clear on how to apply this and syntax.
Would the "blaat.php" be my submit to destination on the server?

This is the OnSubmit line from my form(close_window() added):

<form onsubmit="return validate()" "close_window()" name="smsform"
id="smsform"
action="http://sms.relay.com/send/sms" method="GET">

It didn't close the window when tested. Do I need a separator between
onsubmit items, or two onSubmits?
Is close_window() a function I must create?

Do I need a <script type="text/javascript"> before your example, and
</script> after?

Thanks
 
G

Guillaume

Neil:
I'm not real clear on how to apply this and syntax.
Would the "blaat.php" be my submit to destination on the server?
This is the OnSubmit line from my form(close_window() added):
<form onsubmit="return validate()" "close_window()" name="smsform"
id="smsform"
action="http://sms.relay.com/send/sms" method="GET">

It didn't close the window when tested. Do I need a separator between
onsubmit items, or two onSubmits?
Is close_window() a function I must create?
Do I need a <script type="text/javascript"> before your example, and
</script> after?

I use to put the javascript code in the targeted page, not in the form.
If this is an option...

<script language="javascript"><!--//
window.close();
//--></script>
 
N

Neil

I don't have access to the page displayed after submit..
I really thought there was a way to close my own popup browser window, after
submit.
 
Joined
Sep 2, 2011
Messages
1
Reaction score
0
Hi every one this the answer i found it works for me

first i open a new popup window with the form to fill includding a PHP that set a variable
$run = 0 ; and once is filled i submitted to itself and trough PHP if statement i'm able to catch those values and insert it on the database , then i reset the variable run like this
$run = 3 ;
and at the end of the file i run this php if satatment one more time
<?PHP if( $run == 3) { echo ' <body onload="self.close()"> ' ;} ?>
i hope that works for you guys and my appologies for my english :)))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top