SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Resistance is Futile webgodjj's Avatar
    Join Date
    Nov 2002
    Location
    Madison, WI USA
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    disable submit button on submit and change value of text

    Hi,

    I have seen this before, and am unsure how to do it. I need to disable the submit button and change the value of the text when a user submits the form.

    <form method="POST" name="ContestForm" action="process.php" onSubmit="return verify()">

    <input type="submit" name="submit" value="Insert/Update" id="submit">

    something like putting a new line in my verity() funciton that would add
    form.ContestForm.submit = disabled
    form.ContestForm.submit.value = processing

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function verify()
    {
       var submitBtn = document.getElementById('submit');
       submitBtn.disabled = true;
       submitBtn.value = 'Processing';
    
       return true;
    }
    Although unless this process is going to take a long time most users will not see the change.



Bookmarks

Posting Permissions

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