Possible Duplicate:
Focus input field with JQuery without selecting current value text
Using the following code to focus the first field in the form:
$(document).ready(function(){
$("form input:visible:enabled:first").focus();
});
Why does it select the text in the field? How to focus the input without selecting the text?
Working in Ruby on Rails. Tested on Chrome.
If you dunno what the value is going to be, you can do:
I’m going to try to find a better solution, though.