Form not submitting after disabled button

C

chad.arimura

I've got a form inside a PHP script that posts to itself, does some
processing on the PHP side, and if it looks good, PHP sends a HEADER
command that redirects the user out. All was fine until I added a
button disabler onSubmit to keep users from submitting twice. Now the
form disables the button as requested but just refreshes the page... it
doesn't get to the HEADER command.

Any idea what the problem might be?

<script language="Javascript">
function disable(theForm) {
theForm.send_email.disabled = true
return (true)
}
</script>

<form action="<?=$_SERVER[PHP_SELF]?t=$_GET[t]?>" method=post name=form
onSubmit="return disable(this)">


Thanks a ton,
Chad
 
R

RobB

I've got a form inside a PHP script that posts to itself, does some
processing on the PHP side, and if it looks good, PHP sends a HEADER
command that redirects the user out. All was fine until I added a
button disabler onSubmit to keep users from submitting twice. Now the
form disables the button as requested but just refreshes the page... it
doesn't get to the HEADER command.

Any idea what the problem might be?

<script language="Javascript">
function disable(theForm) {
theForm.send_email.disabled = true
return (true)
}
</script>

<form action="<?=$_SERVER[PHP_SELF]?t=$_GET[t]?>" method=post name=form
onSubmit="return disable(this)">


Thanks a ton,
Chad

Is there anything in that php that examines the send_email
($_POST['send_email'] e.g.) data? That button won't submit any if it's
disabled.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top