WHat am I doing worn with this code?? I am trying to create a submit popup confirmation beofre inserting record into DB and if they cancel they are returned to my index.jsp page.. I am messed with the script a few different ways but am still having issues
<form id="myform" action ="insertNew" method ="get">
<td align="right">Name: </td><td> <input type="text" name="name"></td></tr>
<tr><td><input type ="submit" onClick="formcheck()" value="Submit"></td></tr>
<script language="Javascript">
function formcheck(){
if (confirm("Are you sure you want to insert?"))
{
form.submit();
}
else
{
document.location.href = "index.jsp"
}
}
</script>
</body>
</html>