EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 16, 2024, 04:37:59 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
setting the focus to textbox inside accordion onSelect event
Pages: [
1
]
« previous
next »
Print
Author
Topic: setting the focus to textbox inside accordion onSelect event (Read 7124 times)
jrnfs
Newbie
Posts: 16
setting the focus to textbox inside accordion onSelect event
«
on:
April 10, 2015, 07:43:53 AM »
Hi,
I have an accordion withing some textboxes. When I select a page I want to set focus to a specific textbox, like
<div class="easyui-accordion" data-options="onSelect:acc_select ... etc, etc...">
<div title="user info" etc..>
<input id='id_user' class="easyui-textbox" ...
function acc_select(title, index) {
if (index = 0) {
$('#id_user').textbox('textbox').focus();
}
}
but nothing happen.
What am I doing wrong?
tks for any answer
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: setting the focus to textbox inside accordion onSelect event
«
Reply #1 on:
April 10, 2015, 08:05:00 AM »
Some mistakes occur in your code, please try this:
Code:
function acc_select(title, index) {
if (index == 0) {
$('#id_user').textbox('textbox').focus();
}
}
Logged
jrnfs
Newbie
Posts: 16
Re: setting the focus to textbox inside accordion onSelect event
«
Reply #2 on:
April 10, 2015, 08:19:34 AM »
Tks for your answer.
Yes, the '=' is wrong, but it is not the real code, my mistake. It still donĀ“t work.
I added a button to do the same code ($('#id_user').textbox('textbox').focus()) and it worked.
I guess there is something wrong with the event handler.
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: setting the focus to textbox inside accordion onSelect event
«
Reply #3 on:
April 10, 2015, 08:28:25 AM »
Please refer to this example
http://jsfiddle.net/fb273m03/
Logged
jrnfs
Newbie
Posts: 16
Re: setting the focus to textbox inside accordion onSelect event
«
Reply #4 on:
April 10, 2015, 08:42:47 AM »
Solved, thank you so much.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...