onclick this.value='Processing... now form is not submitting?

Posted on 2007-08-06
Last Modified: 2012-06-22
my form did work fine, but now i have added some javascript "onclick" the form no longer seems to submit, although the onclick does change the text. any ideas? thanks


<input type="Submit" name="imageUpload" value="Click to Upload"  onclick="this.value='Processing...';this.disabled=true;">

Question by:pigmentarts
    LVL 7

    Expert Comment

    You need to return true from the onClick processing. You can either add that inline like this:

    onclick="this.value='Processing...';this.disabled=true;return true;".

    Or better, create a Javascript function that performs the two statements you have, and then returns true. And change the onClick like this:
    onclick="return doOnClick(this);"

    - Ravs
    LVL 75

    Expert Comment

    by:Michel Plungjan
    Err no. You need to not disable the submit until the form is actually submitted
    LVL 75

    Accepted Solution

    Like this

    <form action="" onSubmit="this.imageUpload.disabled=true;" >
    <input type="text" name="q" value="disable submit submit">
    <input type="Submit" name="imageUpload" value="Click to Upload"  onclick="this.value='Processing...';">

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
    JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
    Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now