EasyUI Forum
April 23, 2024, 03:40:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [solved] input (textbox) set focus  (Read 8017 times)
frankz
Newbie
*
Posts: 16


View Profile
« 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?
« Last Edit: November 18, 2017, 01:39:50 AM by frankz » Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #1 on: October 31, 2017, 06:37:43 AM »

Try this:
$('#User').focus();
or
document.getElementById("User").focus();
Logged
frankz
Newbie
*
Posts: 16


View Profile
« Reply #2 on: October 31, 2017, 09:49:29 AM »

I tried the two solutions, but they did not work.
can it depend on other settings?
Logged
tumbas
Newbie
*
Posts: 5


View Profile Email
« Reply #3 on: November 05, 2017, 06:28:27 AM »

try this bro
Quote
$('#user').textbox('textbox').focus();
Logged
frankz
Newbie
*
Posts: 16


View Profile
« Reply #4 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
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!