0

i am new to JSP and this is my first trial on JSP
i have a table "des"
1. id - auto increment
2. desn - varchar(50)

and i wanted to access the table data on my JSP(index.jsp) file:

<%@ page import="java.sql.*" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Add Employee</title> <script>
            function set_val(spn,vl){
                if(vl){
                    document.getElementById(spn).style.color="Green";
                    document.getElementById(spn).innerHTML="Valid!";
                }
                else{
                    document.getElementById(spn).style.color="Red";
                    document.getElementById(spn).innerHTML="Invalid Entry!!";
                }
            }
            function validate_name(x){
                var patt = /^[a-zA-Z]{4,30}$/;
                if(patt.test(x.value)){
                    set_val("val_name",true);
                }
                else{
                    set_val("val_name",false);
                }
            }
            function validate_addr(x){
                var patt = /^[-a-zA-Z\s\,\.]{5,50}$/;
                if(patt.test(x.value)){
                    set_val("val_addr",true);
                }
                else{
                    set_val("val_addr",false);
                }
            }
        </script> </head> <body> <form action="addnverify.jsp" method="post" name="empp"> <table width="80%" align="center" border="1px" cellpadding="1px" cellspacing="1px"> <tr><TH colspan="3">Employee Registration</TH></tr> <tr> <th align="left">Name</th> <td><input type="textbox" onblur="validate_name(this);" name="empname"></td> <td><span id="val_name" style="text-align: right;"></span> </tr> <tr> <th align="left">Address</th> <td><textarea rows="5" cols="50" onblur="validate_addr(this);" name="empaddr"> 
Attachments Clipboard02.jpg 53.17 KB Clipboard01a.jpg 26.08 KB Clipboard01.jpg 20.24 KB
2
Contributors
1
Reply
6
Views
2 Years
Discussion Span
Last Post by Taywin
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.