Is it possible to have a submit button conditional on the JS confirm()?
In other words, the form will not be submitted if the Cancel is selected in the confirm().
Todd
<script language="JavaScript" type="text/JavaScript"> function set_no(clear) { if(!clear) document.getElementById("text").innerHTML='<input type="reset" name="Reset" value="I\'m not sure" onclick="set_no(1)"> <input type="button" onClick="submit()" name="Submit" value="i am sure...">'; else document.getElementById("text").innerHTML=''; } </script> <body> <form name="form1" method="get" action=""> Values: <input type="text" name="textfield"> <input name="Submit" type="button" value="Submit" onclick="set_no()"> <font id="text"></font> </form>
Very clever!! Many thanks!
function checkIt(){ if(confirm('Are you sure?')) return true; return false; } <input type="submit" onclick="checkIt();" />
Although I may have missed the question based on your response to the previous poster.