Hi
using jquery, i'm trying to disable an input field like this.
<input id="submit" type="image" src="submit.jpg"/>
What i would like to do is disable the button and change the image with a different image (submitGreyed.jpg) to visually notify that button is disabled. With the following line i disable the button:
JQuery("#submit").attr('disabled','true');
with this i change the image
JQuery("#submit").attr('src','submitGreyed.jpg');
and once disabled i submit the form with
JQuery("#form").submit();
the second line has some weird behaviour; sometimes works and sometimes don't.
When it works, button is disabled, image changed and form is submitted; when it does not work, button is disabled, form is submitted but image is not changed.
Do you think is a problem that can be resolved with image preloading? Many thanks.