EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: frankz on October 31, 2017, 05:39:52 AM



Title: [solved] input (textbox) set focus
Post by: frankz on October 31, 2017, 05:39:52 AM
I have a problem setting focus in textbox in a modal windows form.
the HTML code:
  <form id = "ff" method = "post">
                <div style = "margin-bottom: 20px">
                    <input id = "user" type = "text" name = "user">
                </ Div>
....
the javascript code:
$ ( '# User'). Textbox ({
label: 'Password:',
labelPosition: 'top',
required: true,
width: 80% ',
});

$ ( '# User'). Textbox.focus ();

but it does not work, where am I wrong?


Title: Re: input (textbox) set focus
Post by: Pierre on October 31, 2017, 06:37:43 AM
Try this:
$('#User').focus();
or
document.getElementById("User").focus();


Title: Re: input (textbox) set focus
Post by: frankz on October 31, 2017, 09:49:29 AM
I tried the two solutions, but they did not work.
can it depend on other settings?


Title: Re: input (textbox) set focus
Post by: tumbas on November 05, 2017, 06:28:27 AM
try this bro
Quote
$('#user').textbox('textbox').focus();


Title: Re:[SOLVED] input (textbox) set focus
Post by: frankz on November 18, 2017, 01:30:41 AM
i have resolved so:
$('#user').textbox('clear').textbox('textbox').focus();

and the windows:
$('#win').window({
    width:300,
    height:250,
    modal:true,
    title:"LOGIN",
   collapsible:false,
   minimizable:false,
   maximizable:false,
   closable:false
});