Closed Thread Icon

Topic awaiting preservation: onclick twice? Pages that link to <a href="https://ozoneasylum.com/backlink?for=8587" title="Pages that link to Topic awaiting preservation: onclick twice?" rel="nofollow" >Topic awaiting preservation: onclick twice?\

 
Author Thread
Fred
Neurotic (0) Inmate
Newly admitted

From: NY, NY
Insane since: Mar 2003

posted posted 03-27-2003 18:51

I have a simple script that when a radio button is clicked a warning pops up. Is it possible to add another "onClick" so that when that button is clicked, the button then is dimmed or hidden?

I use the following for the warning:


<INPUT TYPE="radio" VALUE="WARNING" onClick="alert(value)" NAME="citizen"> No

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 03-27-2003 20:02

you could try to seperate two commands with a ';', but the usual approach would be to write a function in a script block before the radio button and call that from the onClick.

so long,

Tyberius Prime

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 03-27-2003 20:11

Hey Fred, welcome

You can't have multiple onclick handlers in one tag, but as you can use the one you have to execute virtually any amount of JavaScript code you can just use a semicolon to seperate the alert() from everything else you might want to happen. For instance, if you wanted two alerts to appear in a row when the button is clicked you'd say

<input type="radio" value="warning" name="citizen" onclick="alert('Message #1'); alert('Message #2');">

and of course you can replace the second alert() with any other command there.


[edit: It's always the same with my slow replies Hope the example helps a bit anyway]

[This message has been edited by kuckus (edited 03-27-2003).]

« BackwardsOnwards »

Show Forum Drop Down Menu