/    Sign up×
Community /Pin to ProfileBookmark

How to accomodate two different onclick

Hi:

I want to use a Javascript whicih is here:

[url]http://javascript.internet.com/messages/please-wait-message.html[/url]

It says I have to use a onclick like this:

onclick=”do_totals1()”

Well, I want to use it on this INPUT command which already has an onclick, look:

<input type=”image” src=”i_b_login.gif” border=”0″ name=”LOGIN” alt=”Log In” value=”TRUE” WIDTH=”104″ HEIGHT=”31″ OnClick=”this.form.SERVER.value=(this.form.SERVER.value.indexOf(‘mail.’)==-1) ? ‘mail.’ + this.form.SERVER.value.replace(‘www.’, ”) : this.form.SERVER.value.replace(‘www.’, ”);”>

So, is there a way to accomodate both onlicks on this same input command:

Thanks a lot.

Mario./

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisSep 21.2003 — [b]is there a way to accomodate both onlicks on this same input command[/b][/quote]
Yes. Put both commands inside the quotes, separated by a semi-colon:
&lt;input ... onclick="this.form.SERVER.value=(this.form.SERVER.value.indexOf('mail.')==-1) ? 'mail.' + this.form.SERVER.value.replace('www.', '') : this.form.SERVER.value.replace('www.', '');do_totals1()"&gt;
Copy linkTweet thisAlerts:
@pyroSep 21.2003 — Multiple functions are separated by semicolons, so just add it after the semicolon or to the beginning with a semicolon at the end of the function name, depending on which you want to run first.
Copy linkTweet thisAlerts:
@mariolimaauthorSep 21.2003 — Hi, Gil, that's great, so simple! Thanks a lot.

Mario./?
Copy linkTweet thisAlerts:
@mariolimaauthorSep 21.2003 — Thanks, Pyro, for your additional hint.

Mario./
×

Success!

Help @mariolima 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,
)...