Form not submitting after disabled button

Discussion in 'Javascript' started by chad.arimura, Apr 2, 2005.

  1. chad.arimura

    chad.arimura Guest

    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)

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

    Thanks a ton,
    chad.arimura, Apr 2, 2005
    1. Advertisements

  2. chad.arimura

    RobB Guest

    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
    RobB, Apr 2, 2005
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.