...

View Full Version : Multiple button functions



AlexCrow
11-07-2012, 01:21 PM
Is there a way of adding more than one function to a button - such as displaying an answer and redirecting to a new page?

Or am I just being too optimistic

jmrker
11-07-2012, 02:28 PM
Try...


HTML:
<button onclick="displayAnswerAndRedirect()">

JS:
function displayAnswerAndRedirect() {
// code to show answer, probably with an alert() because redirection next will not display long.
//...
// code to redirect
document.location.href = "http://somewhere.com?????";
}


Code is untested.,,

vwphillips
11-07-2012, 03:36 PM
<input type="button" name="" value="TEST" onmouseup="MyFunction1();MyFunction2();" />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum