By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,620 Members | 1,852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,620 IT Pros & Developers. It's quick & easy.

Form not submitting after disabled button

P: n/a
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

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
chad.arim...@gmail.com wrote:
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.

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.