/    Sign up×
Community /Pin to ProfileBookmark

on click of an image,change the image to something else

I have an image(submit.gif) which acts as a submit button,However when this is clicked I want this image to the change to a non submit image(processing.gif)

Is this possible please??Any help appreciated???

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JJan 26.2005 — Please try the following

<img src="submit.gif" onclick="this.src='processing.gif'">
Copy linkTweet thisAlerts:
@aido123authorJan 26.2005 — this does change the image but it does not disable people clicking it and using it as a submit button??

if you see the code i am using

<form name="form1" action="hello.html" method="post">

<input type="image" name="Place Bet" src="PlacingBets.gif" onclick="this.src='caf_bottom_04.gif'" alt="Click here to place your bet" width="92" height="22" hspace="0" vspace="0" border="0" onClick="javascript?oSandTimer()">

</form>
Copy linkTweet thisAlerts:
@Mr_JJan 26.2005 — You did not say you wanted to disable the button.

You will have to put a statement in function DoSandTimer which will disable the button and another one elsewhere to re-enable it, post your code so that I can take a look.

Also you do not use 2 onclick events

<form name="form1" action="hello.html" method="post">

<input type="image" name="Place Bet" src="PlacingBets.gif" [B]onclick="this.src='caf_bottom_04.gif' ; DoSandTimer()"[/B] alt="Click here to place your bet" width="92" height="22" hspace="0" vspace="0" border="0">

</form>
×

Success!

Help @aido123 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...