set focus to textbox on blur validation...I am doing character strength validation on the blur event of textbox..How to set focus to it...

Recommended Answers

All 3 Replies

Without your code, not sure, but I would start by suggesting using the focus method.

 document.getElementById('elementID').focus()

Yup, the focus() function sets the focus to the target element :). For documentation, click here.

jQuery can do that for you too ...

$(document).ready(function() {
   $('#txtBoxId').focus();
 });
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.