/    Sign up×
Community /Pin to ProfileBookmark

Simple image button in JavaScript

Im trying to make a simple button with an image in JavaScript for my web page. The code is

<FORM>
<INPUT type=”image” src=”Files/ContinueButton.png” name=”button1″ style=”z-index: 0; left: 105px; position: absolute; top: 310px” onClick=”continue() “>
</FORM>

Everything else is ok, except when i click the button it should execute function continue() but it doesnt.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayJun 08.2011 — Syntax looks correct, are you getting an error when loading or when clicking the button?
Copy linkTweet thisAlerts:
@ErkkiQazwizauthorJun 08.2011 — I dont get any errors or anything, but when i click the button it doesnt run the function and adds

?button1.x=140&button1.y=20

to the URL bar, and it shouldnt do that
Copy linkTweet thisAlerts:
@ErkkiQazwizauthorJun 08.2011 — It doesnt work no matter what browser i use.
Copy linkTweet thisAlerts:
@ErkkiQazwizauthorJun 08.2011 — Some1 please help...
Copy linkTweet thisAlerts:
@ErkkiQazwizauthorJun 08.2011 — Oh, i found the problem..

I used "continue" as a name of a function but continue is a function like in javascript so it ran the continue thing when i pressed the button, not my continue function.
×

Success!

Help @ErkkiQazwiz 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 5.16,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...