Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find object from string 2

Status
Not open for further replies.

ThorO

Programmer
Sep 28, 2002
20
NO
Hi guys

I have a form which is sent to the server using AJAX and it has some serverside validating and when a error occur I will alert the user and put focus on the field which gives the error. I send back from server the string (responsetext) which I use split in Javascript to set up. I have after the split e.g. response[0] with the name of the object that did not pass the server test (e.g. wrong password and the name of the password field is passw, response[0]=passw). What do I do to set focus on passw??
Thanks in advance
ThorO
 
You'd use something like:

Code:
document.forms['your form name here'].elements['passw'].focus();

Lee
 
Hi Lee

Thanks, works great now...:)

Have a great day

ThorO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top