Step 1 : Develop a index.jsp form
Step 2 : Develop a appropriate register.jsp form
OutPut:
<html>
<head>
<script src="jquery-2.0.3.js"></script>
<script>
$(document).ready(function() {
alert("jq called");
$(".store").click(function(){
var name=$("#name").val();
var pwd=$("#pwd").val();
var age=$("input#age").val();
var address=$("input#address").val();
var dataString = 'name='+ name
+'&pwd='+pwd
+'&age='+ age
+'&address='+ address;
$.ajax({
type: "post",
url: "register.jsp",
data: dataString,
cache: true,
success: function(responseText)
{
$("#sh").html(responseText);
}
});
return false;
});
});
</script>
</head>
<body>
<input type="text"
id="name" name="name"
placeholder="Enter UserName" /></div>
<div>
<input type="password"
id="pwd" name="pwd"
placeholder="password" /></div>
<div>
<input type="text"
id="age" name="age" placeholder="age"
/></div>
<div>
<input type="text"
id="address" name="address" placeholder="address"
/>
</div>
<input type="submit"
value="store" class="store"/>
<div id="sh"></div>
<div>
</body>
</html>
Step 2 : Develop a appropriate register.jsp form
Hi<font color="red">
<%=request.getParameter("name")%></font> Registration was
Success...<br>
OutPut:
0 comments:
Post a Comment