Home Answers Viewqa Ajax html login page with ajax

 
 


vanchinathan R
html login page with ajax
1 Answer(s)      9 months ago
Posted in : Ajax

hi all... i want to create a login page using html and ajax for validation is must. please help me doing that with code...

thanks in advance

View Answers

September 4, 2012 at 3:39 PM


Here is a jsp example that accepts username and password from the user and check whether the user is valid or not by using ajax.

1)ajaxLogin.jsp

<html>
<head>
<script language="javascript">
function postRequest(strURL){
var xmlHttp;
if(window.XMLHttpRequest){ 
var xmlHttp = new XMLHttpRequest();
}
else if(window.ActiveXObject){ 
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlHttp.open('POST', strURL, true);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.onreadystatechange = function(){
if (xmlHttp.readyState == 4){
updatepage(xmlHttp.responseText);
}
}
xmlHttp.send(strURL);
}

function updatepage(str){
if(str=="yes"){
alert("Welcome User");
}else{
alert("Invalid Login! Please try again!");
}
}

function call_login(){
var username = window.document.f1.username.value;
var password = window.document.f1.password.value;
var url = "check.jsp?username=" + username + "&password=" +password ;
postRequest(url);
} 
</script>
</head>

<body>
<Center>

<form name="f1" onsubmit="return call_login();">
<table border="0" bgcolor="#CCCCFF" cellspacing="1" cellpadding="3" width="287">
<tr>
<td align="left" colspan="2" width="275"><b><font size="5" color="#000080">Login</font></b></td>
</tr>
<tr>
<td align="right" width="81"><b><font color="#000080">User
Name:</font></b></td>
<td width="184"><input type="text" name="username" id="user" size="20" value="" /></td>
</tr>
<tr>
<td align="right" width="81"><b><font color="#000080">Password:</font></b></td>
<td width="184"><input type="password" name="password" size="20" value="" /></td>
</tr>
<tr>
<td colspan="2" align="center" width="275"><input type="button" name="a1" value="Login" onclick="call_login()"></td>
</tr>
</table>
</form>

</center>
</body>
</html>

2)check.jsp:

<%
String username=request.getParameter("username");
String password=request.getParameter("password");
if(username=="admin" && password=="admin"){
out.println("yes");
}else{
out.println("no");
}
%>









Related Pages:
html login page with ajax
html login page with ajax  hi all... i want to create a login page using html and ajax for validation is must. please help me doing that with code... and password from the user and check whether the user is valid or not by using ajax
HTML login page code
HTML login page code  Hi all, I am writing my first HTML JavaScrip... the complete HTML JavaScript code for User Login Page. Thanks in Advance!   ...;td colspan=2><font size=3><center><b>HTML Login Page
login page
login page  hi i'm trying to create login page using jsp. i get... the program. Following are my programs... 1.index.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Page
HTML Login Page Code
HTML Login Page Code Here is an example of html login page code.... HTML Login page with JavaScript Validation <html> <body> <... JavaScript validation in Login page. We have set username and password value
Login through database with the help of jQuery 'ajax' & JSP
a login page , which has a JSP page to perform database connection. In this example , login page contain jQuery ajax to make connection with JSP ,which...Login through database with the help of jQuery 'ajax' & JSP
html
html  how we can give the form actions in html after register button in the login page
using ajax and jsp (struts) to login and remain on same page.
using ajax and jsp (struts) to login and remain on same page.  I am a fresher... I can forward my login page to success page using struts, but I want to remain on same login page and just want to display loggers name ... I don't
login page
login page  code for login page
Login page
Login page  how to create Login page in java
Login Form using Ajax
Login Form using Ajax      ... using the Ajax (DOJO).  Lets develop a login application using Ajax...;/action> Develop a Login Form Using Ajax : The GUI of the application
login
login  login page display an error showing failure to login even when the correct information is entered
login page
login page  How to login as different user in php
Login Page
Login Page  Can anyone tell me the steps to create a login page in myeclipse 7.0 and validating it with login database in db2 9.7 ??? Please tell me
login
login  how to login admin and user with the same fields(name & password) in single login page while the table for admin and user is seprate in database(mysql) please provide me solution
LOGIN PAGE
LOGIN PAGE  A java program with "login" as title,menus added, and a text field asking for firstname, lastname, and displaying current date and time
Ajax Login Example
Ajax Login Program      ... button,  'call_login()' function is called. This method sends ajax request... from database. Example of Ajax login Program : <html> <head>
login page
login page  pls say how to create a login page in jsp and mysql using netbaens   Hi Friend, Please visit the following links: http://roseindia.net/jsf/netbeans/index.shtml http://roseindia.net/jsp/loginbean.shtml
login
login  how to create login page in jsp   Here is a jsp code that creates the login page and check whether the user is valid or not. 1...;tr><td></td><td><input type="submit" value="Login">
login
loggedinto next page   Hi Friend, Try the following code: 1... java.awt.event.*; class Login { JButton SUBMIT; JLabel label1,label2; final JTextField text1,text2; Login() { final JFrame f=new JFrame("Login Form
verfication of user login and then redirecting it to user defined page
; hi, i have a login page that..calls the servlet..and i have used redirect...,the html page calls teh servlet..but..the servlet.is not redirecting to a user defined page.. after i press the submit button..in the login page, i am getting
ajax login example
ajax login example  hi deepak, i am trying to execute ajax login example in eclipse but it show the form but when I enter admin admin it shows invalid credentials how to resolve
Find currenly which field is having focus on html page? - Ajax
Find currenly which field is having focus on html page?  Hi All, Actually I want to ask question about Javascript, but there is no any option in Category. My problem is I have two form on single html page with two different
login example
login example  1.Loginpage.jsp <%@ page language="java...-Type" content="text/html; charset=windows-1256"> <title>Login...; 2.invalidLogin.jsp <%@ page language="java" contentType="text/html; charset
login example
login example  1.Loginpage.jsp <%@ page language="java...-Type" content="text/html; charset=windows-1256"> <title>Login...; 2.invalidLogin.jsp <%@ page language="java" contentType="text/html; charset
coding for login page
coding for login page  coding for login page
filter and display html table data using ajax - Ajax
filter and display html table data using ajax  Hi i am stuck up at a situation where i have a jsp page from where the control goes to the .js file calling the ajax function called retrieveURL.from here goes
facebook login button html
facebook login button html  facebook login button html i have a facebook login button code ..but not sure how to use it. Can any one please explain? Here is the facebook login button code in html <fb:login-button
Jdbc Login Page Validation using Combobox
Jdbc Login Page Validation using Combobox  I got Login By this code i want to login by validating with combobox....The link which you send its without combobox.i m unable to get login by verifying with combo box..Ex banglore
login page in php
login page in php  How to create a login page in php
Ajax Web Framework, Frameworks for Ajax
the knowledge of HTML, CSS, JavaScript and Ajax. In this kind of framework developer... into Ajax, HTML and JavaScript. In such framework high level language is used... HTML and JavaScript for Ajax support. The server-side framework renders
Jdbc Login Page Validation using Combobox
Jdbc Login Page Validation using Combobox  I am beginer to java i am.../html; charset=UTF-8"> <title>Celcabs Login Page</title> <....... Thanks alot Index.jsp <%@ page language="java" contentType="text
Jdbc Login Page Validation using Combobox
Jdbc Login Page Validation using Combobox  I am beginer to java i am.../html; charset=UTF-8"> <title>Celcabs Login Page</title> <....... Thanks alot Index.jsp <%@ page language="java" contentType="text
Developing responsive Ajax based Applications with ajax technologies
day by day, it is good to connect an HTML page with XML, with the help... address dynamically with the help of AJAX, HTML, & PHP.   ...; Ajax Login Example In this program you will learn  how to validate
AJAX- Database not connected - Ajax
only the HTML Contents from JDBC page and Database codings not executed... What...AJAX- Database not connected  Respected Sir/Madam, I am Ragavendran.R.. I am working with AJAX and Database.. Ajax code works fine
Login or Cancel Application Using Ajax
Login or Cancel Application Using Ajax     ... Using Ajax : The GUI of the application consists of a login form...;ajaxloginsuccess.jsp" page displays the Login Success message (Welcome
any alternaive for AJAX - Ajax
a page. And you can find various other alternatives of Ajax to create your... developing a web application for my final year project. very one knows AJAX which... any... given below to create application in ajax
ajax display - Ajax
ajax display  I send request from ajax page to servlet... i got response from servlet to ajax as a string.. i want to display that string line..., Code to solve the problem : "mainpage.jsp" Ajax
ajax example
Example Ajax Login Example Thanks Ajax Tutorials  Collection of top... in jsp page?   Hi, Please read Ajax First Example - Print Date...Ajax Example Here is the list of few Ajax examples at RoseIndia.net. Ajax
ajax programming
is based on the HTML, Java Script, CSS, and XML. Why Ajax Programming? When you... of the page as it has update only a section of the page. Ajax is a platform... page which can communicate with an XML page using Ajax and PHP.  
Ajax
Ajax at Ajax Tutorial page...Ajax  Hi, What is Ajax? What is the use of Ajax? Thanks   Hi, Ajax is set of technologies used to develop dynamic web applications
HTML Prototype
HTML Prototype       HTML::Prototype contains some code generators for Prototype, the famous JavaScript OO... to the Prototype helpers in Ruby Ajax Frameworks#Ruby On Rails. Read full Description
login page code in asp.net
login page code in asp.net  i need front end and backend code for login page in vb asp.net using sql server....having code for submit button
problem in linking the html page using servlets
problem in linking the html page using servlets  i want to create a login page using html & servlets and as soon as i click the login button it should open my home page. and i have saved username and password in a database
jsp login page
jsp login page  hi tell me how to create a login page using jsp and servlet and not using bean... please tell how to create a database in sql server... please tell with code
SSL for login page
SSL for login page  I am trying to apply ssl cert to login page only. Does anyone know how to do this on a tomcat web server
how to include an html page inside a tab
how to include an html page inside a tab  how to include an static html page inside a tab(in jquery)   Please visit the following links: http://www.roseindia.net/ajax/jquery/Tabs.shtml http://www.roseindia.net/ajax
login page error
login page error  How to configure in to config.xml .iam takin to one login form in that form action="/login" .when iam deployee the project... this request." please suggest me.   if your login page is prepared
JSP LOGIN Page
JSP LOGIN Page  sir....i have two user types usercategory and user and both user have userid and password in two different table and now i am making login page for which i have to retrieve usertype,userid and password from two
login page - Java Beginners
login page  I have one login page in jsp that is login.jsp. Now i have validate user from database by another page validate.jsp. but if the user feeded wrong information then i want to print error massege on the first page