Click to See Complete Forum and Search --> : How to accomodate two different onclick


mariolima
09-21-2003, 04:14 PM
Hi:

I want to use a Javascript whicih is here:

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

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./

gil davis
09-21-2003, 05:00 PM
is there a way to accomodate both onlicks on this same input command
Yes. Put both commands inside the quotes, separated by a semi-colon:
<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()">

pyro
09-21-2003, 05:01 PM
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.

mariolima
09-21-2003, 05:58 PM
Hi, Gil, that's great, so simple! Thanks a lot.

Mario./:)

mariolima
09-21-2003, 05:59 PM
Thanks, Pyro, for your additional hint.

Mario./