EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: wade.zhu on August 03, 2014, 08:20:26 PM



Title: how can i focus the textbox
Post by: wade.zhu on August 03, 2014, 08:20:26 PM
before v1.4, i use validatebox, and i could val('some text') or focus() the validatebox
now if i change to textbox, how could i focus the textbox?


Title: Re: how can i focus the textbox
Post by: hjzhbb7758 on August 03, 2014, 10:18:01 PM

$('#textbox').textbox('clear').textbox('textbox').focus();


Title: Re: how can i focus the textbox
Post by: wade.zhu on August 03, 2014, 11:50:05 PM
yeah, it works.
and here is another issue
before v1.4, i could align the validatebox text using style="text-align:right"
now i have to code .textbox('textbox').css('text-align', 'right') after component parsed
i read the document, only 'iconAlign', 'buttonAlign' properties found, no 'textAlign' or something else property found.


Title: Re: how can i focus the textbox
Post by: korenanzo on October 23, 2014, 08:58:49 AM

$('#textbox').textbox('clear').textbox('textbox').focus();

I use a more generic way, you can use it even with other kind of objects, as combobox.

$('#textbox').next().find('input').focus()


Title: Re: how can i focus the textbox
Post by: tumbas on November 05, 2017, 06:17:47 AM
i use this script and works

Quote
$('#name').textbox('textbox').focus();