
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Description" content="Information architecture, Web Design, Web Standards." />
<meta name="Keywords" content="your, keywords" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Distribution" content="Global" />
<meta name="Author" content="Erwin Aligam - ealigam@gmail.com" />
<meta name="Robots" content="index,follow" />
<link rel="stylesheet" href="images/telecom.css" type="text/css" />
<title>BluePigment</title>
<script type="text/javascript">
function validate()
{
//Name validation
var a=document.frm.name.value;
if(a=="")
{
alert("Please enter the name");
return false;
}
if(!isNaN(a))
{
alert("Please enter the correct name");
return false;
}
if(a.length > 25)
{
alert("Please enter name less than 25 characters");
return false;
}
//License validation
var b=document.frm.licence.value;
if(b=="")
{
alert("Please enter the License number");
return false;
}
if(isNaN(b))
{
alert("Please enter the correct Licence number");
return false;
}
//Address validation
var c=document.frm.address.value;
if(c=="")
{
alert("Please enter address");
return false;
}
//Contact validation
var d=document.frm.cno.value;
if(d.length!=10 )
{
alert("Please enter valid contact number");
return false;
}
if(isNaN(d))
{
alert("Please enter valid contact number");
return false;
}
//Email-id validation
var e=document.frm.email.value;
if((e.indexOf("@")==-1) || (e.indexOf(".")==-1))
{
alert("Please Enter valid Email-id");
return false;
}
if((e.indexOf("@")!=e.lastIndexOf("@"))||(e.lastIndexOf(".")-e.indexOf("@")<=2))
{
alert("Please Enter valid Email-id");
return false;
}
//DOB validation
var f=document.frm.date.value;
if(f=="")
{
alert("Please enter valid date");
return false;
}
alert("You have submitted data successfully.");
return true;
}
</script>
</head>
<body>
<!-- header starts here -->
<div id="header"><div id="header-content">
<h1 id="logo-text"><a href="index.html" title="">Telecom<span>Inventory</span><span>Store</span></a></h1>
<h2 id="slogan">One Roof For All...</h2>
<div id="header-links">
<p>
<a href="index.html"></a>
<a href="index.html"></a>
<a href="index.html"></a>
</p>
</div>
</div></div>
<!-- navigation starts here -->
<div id="nav-wrap"><div id="nav">
<ul>
<li><a href="home.html">Login</a></li>
<li ><a href="retailerRegistration.html">Retailer Registration</a></li>
<li id="current"><a href="imRegistration.html">IM Registration</a></li>
<li><a href="index.html"></a></li>
<li><a href="index.html"></a></li>
</ul>
</div></div>
<!-- content-wrap starts here -->
<div id="content-wrap"><div id="content">
<div id="sidebar" >
</div>
<div id="main">
<div class="box">
<a name="TemplateInfo"></a>
<h1><a href="index.html">Welcome <span class="white">Inventory Manager</span></a></h1>
</div>
<div class="box">
<a name="SampleTags"></a>
<h1><a href="index.html"><span class="white">Inventory Manager</span> Registration</a></h1>
<h3></h3>
<form name="frm" method="post" action="InsertServlet" onsubmit="return validate()">
<p>
<label>Name</label>
<input name="name" type="text" placeholder="Name" size="30" />
<label>Licence Number</label>
<input name="licence" type="text" placeholder="License Number" size="30" />
<label>Address</label>
<textarea name="address" placeholder="Address" rows="1" cols="3"></textarea>
<br />
<label>Contact Number</label>
<input name="cno" type="text" placeholder="Contact Number" size="30" />
<label>Email</label>
<input name="email" type="text" placeholder="Email id" size="30" /><br/><br/>
<label>Date of Birth</label>
<input type="text" name="date" size=10 placeholder="dd" maxlength=10/>
<br/><br/>
<input name="registerM" class="button" type="submit" value="Register" />
<input class="button" type="reset" value="Cancel"/>
</p>
</form>
</div>
<br />
</div>
<!-- content-wrap ends here -->
</div></div>
<!-- footer starts here-->
<div id="footer-wrap">
</div>
<font size=2>
<div id="footer-bottom">
<p>
© 2012-2013 Tata Consultancy Services Limited. All Rights Reserved
</p>
</div>
</font>
<!-- footer ends-->
</div>
</body>
</html>
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class Connections {
static Connection con=null;
static Statement st=null;
public static void theconnect()
{
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/vinay","root","yanivx");
st=con.createStatement();
}
catch(Exception e)
{
System.out.println(e);
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.