Results 1 to 5 of 5
  1. #1

    Javascript to disable submit form won't submit data

    I have searched for various javascript codes to disable the submit button after submit. Including the ones taken from scripts I use on my own site but for some reason they are not working. The disable the submit button when you click it but the form isn't submitted. It just stays on the same page while the button is disabled. Is there anything I am doing wrong? Thanks.

  2. #2
    Join Date
    Aug 2002
    Have you checked this one,

    It seems to be working.
    Vinsar.Net - Quality Web Hosting at Economical Price on USA & European Servers
    Offering domains, shared, reseller & VPS hosting.
    Reliable Domain Reseller Account Resell Domains with Confidence

  3. #3
    Yeah I tried that one and when you clicked submit the button would be disabled but the form wouldn't perform the action. I wonder is it because my form is not directed to a new page but only uses $_POST['action']?

  4. #4
    Join Date
    May 2004
    Pflugerville, TX
    You could use a simple DOM scripting technique to hide the button as form data are being sent.

    function whatev() {
    	document.getElementById('submitbutton').style.visibility = 'hidden';
    <form id="myform" method="post" action="">
    <input type="submit" id="submitbutton" onclick="whatev(); return false;">
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  5. #5
    Ok yeah I have learned something new. It appears as though those disable buttons do not work with you use $_POST['blah'] as the action. I use POST so that the errors appear at the top of the form that the person is using instead of being directed to another page and having to go back to the previous page to fix the errors.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts