We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,277 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Form submit confirmation issues

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>
1
Contributor
0
Replies
1
View
mcddewitt
Newbie Poster
7 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0507 seconds using 2.64MB