TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vinay singh
NA
0
1.1k
Make Focus On Text box by using javascript.
Nov 10 2009 2:00 AM
Hi,
I am working on a project in which there are two textbox one for user id and other for password.
The requirement is that if user enter incorrect user id on that case focus goes to user id text field and if user enters correct user id and wrong password in that case it should show focus on password box.
i have written the below code:
if(objXMLHttp_Login.responseXML.getElementsByTagName(string)[0].childNodes[0].nodeValue == 2)
{
alert(Incorrect E-mail address, user does not exist.);
document.all(txt_username).focus();
document.getElementById(txt_password).value="";
document.getElementById(txt_username).value="";
document.getElementById(div_pre_login).style.display = '';
}
else if(objXMLHttp_Login.responseXML.getElementsByTagName(string)[0].childNodes[0].nodeValue == 0)
{
alert(Incorrect Password.);
document.getElementById(div_pre_login).style.display = '';
document.all.item('txt_password').focus();
document.getElementById(txt_password).value="";
}
Thanks & Regards
Vinay Singh
Reply
Answers (
4
)
Using Frameset in asp.net 2.0
Requesting to review my code from retrieving image from sql database