set focus on textbox value at the end

To set focus on textbox Value at the End using javascript follow the steps:

1.Assuming ‘Search’ is the id given for the Textbox.
2.setFocus() function called on BODY load.
3.The function will position the cursor at the end of the Textbox value
(if any value Present it will point at the end of the value)

function setFocus()
{
var field = document.form.Search;
field.focus();
field.value = field.value;
field.focus();
}

 

Demo Link

Popularity: 1% [?]

You can leave a response, or trackback from your own site.

Leave a Reply

Designed by: Business Web Hosting | Thanks to Buy Icons, travel tips and Used Cars