I am trying to do, form1 is hidden right now, if that username and password correct as in my code, than show form1 in same tab/window, so if username and password correct than next page says Hello! logged in, Is there any way that, i can do that?? I know i can create another html, if username and password correct than show that html, I can do that, I want to send html by email to if i send two html it won't work so, is there any way that i can do everything in one html, if username and password correct than show that hidden form.. Please help me!! Thanks!!
<!DOCTYPE html>
<!-- saved from url=(0042)http://jsfiddle.net/DrydenLong/RHwLW/show/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo by DrydenLong</title>
<script type="text/javascript" src="./- jsFiddle demo by DrydenLong_files/jquery-1.9.1.js"></script>
<script type="text/javascript" src="./- jsFiddle demo by DrydenLong_files/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="./- jsFiddle demo by DrydenLong_files/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="./- jsFiddle demo by DrydenLong_files/result-light.css">
<style type="text/css">
#hello, #sorry {
display: none;
}
</style>
<script type="text/javascript">//<![CDATA[
$(window).load(function(){
$(document).ready(function(){
$("#my_button").click(function(){
var userid = $("#user").val();
var pass = $("#pass").val();
if (userid == 'username' && pass == 'password') {
$("#login").fadeOut('slow', function () {
$("#hello").fadeIn();
});
} else {
$("#login").fadeOut('slow', function () {
$("#sorry").fadeIn();
});
}});});
});//]]>
</script>
</head>
<body>
<div id="login">
<form name="login">Username
<input type="text" name="userid" id="user">Password
<input type="password" name="pswrd" id="pass">
<input type="button" value="Login" id="my_button">
<input type="reset" value="Cancel">
</form>
</div>
<div id="hello">Hello! You are logged in.</div>
<div id="sorry">Sorry you have entered the wrong username or password</div>
</body></html>
Please help me!! Thanks!!