PDA

View Full Version : 2 events in 1 onClick??


Speedy
01-03-2006, 10:40 PM
Hi,

is it possible to have 2 events executed in a single onClick function?

This is the code I want to insert an Confirm(Alert) window in

<button onClick="window.location='admin.asp?Page=EditContent&ContentId=1'">Click here!</button>


any ideas?

/Speedy

GJay
01-03-2006, 10:44 PM
put a ; (semi-colon) after the first command, then put the second one, but

<input type="button" onclick="blash;blah2" />

Is the better (more modern/standards-compliant) HTML...

Kor
01-04-2006, 09:19 AM
if the handler triggers directly some statements/assigment/methods:
<input type="button" onclick="statement1;statement2">
but if you call functions
<input type="button" onclick="function1();function2()">
or you may combine