EnzoDerek Posted June 9, 2006 Share Posted June 9, 2006 Does any1 know how to throw an if else statement on a button like this:<head><script type="text/javascript">function disp_alert(){alert("I am an alert box!!")}</script></head><body><form><input type="button" onclick="disp_alert()" value="Display alert box"></form></body>????????????????????????????????????PLEASE HELP ME!!! Link to comment Share on other sites More sharing options...
pulpfiction Posted June 9, 2006 Share Posted June 9, 2006 Do you want to use a IF statement in the JS function?? Check this out...http://www.w3schools.com/js/js_if_else.asp Link to comment Share on other sites More sharing options...
aspnetguy Posted June 9, 2006 Share Posted June 9, 2006 <head><script type="text/javascript">function disp_alert(){ if(somecondition) { //do something } else { //do something else }}</script></head><body><form><input type="button" onclick="disp_alert()" value="Display alert box"></form></body> Is this what you want? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now