Welcome Guest, Not a member yet? Register   Sign In
Setfocus on textfield
#1

[eluser]01010011[/eluser]
Hi,

How do I set the insertion point in an HTML text field? I am using the form_open function and all of the examples I see on the Web require the use of the form name and a little Javascript.
#2

[eluser]eoinmcg[/eluser]
with jquery:

Code:
// for the first textfield on the doc
$(document).ready(function(){
    $('textarea:first').focus();
});

Code:
// select textfield by id
$(document).ready(function(){
    $('textarea#id_name:first').focus();
});
#3

[eluser]01010011[/eluser]
Thanks for your reply eoinmcg. I will try it.

[quote author="eoinmcg" date="1271559711"]with jquery:

Code:
// for the first textfield on the doc
$(document).ready(function(){
    $('textarea:first').focus();
});

Code:
// select textfield by id
$(document).ready(function(){
    $('textarea#id_name:first').focus();
});
[/quote]




Theme © iAndrew 2016 - Forum software by © MyBB