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

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;">

LVL 12
Who is Participating?
Michel PlungjanConnect With a Mentor IT ExpertCommented:
Like this

<form action="http://www.google.com/search" 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...';">
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
Michel PlungjanIT ExpertCommented:
Err no. You need to not disable the submit until the form is actually submitted
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.