
<%@page language="java" import="java.util.*,java.sql.*"   contentType="text/html"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="css/sty.css" rel="stylesheet" type="text/css"></link>        
		 <script>
               function enter(){
             if(event.keyCode==13)
  {
      validate();
  }
          }
            function validate()
            {
                  var b=f1.serial.value;
           if((b>='a'&&b<='z')||b==""||b==null)
	window.alert("please enter number");
          
    else {
            document.getElementById('f1').action='dupdate.jsp';
            document.getElementById('f1').submit();
        
        } 
            }
        </script>
    </head>
    <body onkeyup="enter()">
        <form name="f1" method="post" id="f1" >
                   <center>
				   <h1>Updating Letter Details</h1>
<hr>
	
		 <% if(request.getAttribute("insert")!=null){%>
   <b><h1> <font color="green"><%=(String) request.getAttribute("insert")%></font></h1></b>
    <%}%>

        <% if(request.getAttribute("error")!=null){%>
   <b><h1> <font color="red"><%=(String) request.getAttribute("error")%></font></h1></b>
    <%}%>
		
		
		<pre>
		
		</pre>
            <table cellspacing=10 cellpadding=5>
          <tr> <td>
                LetterSerial no:
            </td>
            <td>
            <input type="text" name="serial"></td>
        </tr>
        <tr>
            <td><input type=button value="Update" onclick="validate()"></td>
            <td><input type="reset" value="Cancel"></td>
        </tr>
        </table>
    </center>
    </form>
    </body>
</html>
