Javascript to change image form submit button src not working.

Posted by james on Stack Overflow See other posts from Stack Overflow or by james
Published on 2010-06-17T21:41:20Z Indexed on 2010/06/17 21:53 UTC
Read the original article Hit count: 119

Filed under:
|
|
|

I'm trying to change the src of an image form submit button using an onclick, but it doesn't seem to be working correctly. Am I missing something?

<input class="submit_image" id="my_form_button" onclick="$('my_form_button').src='/images/buttons/submitting.gif'" src="/images/buttons/submit.gif" type="image" /> 

I've also tried using the same JS on the form tag using onsubmit with no luck.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about prototype