如何在弹出窗口中设置第一个文本框的焦点 [英] How to set focus for first textbox in popup

查看:70
本文介绍了如何在弹出窗口中设置第一个文本框的焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在按钮单击事件中有一个弹出窗口..在此弹出窗口中,我有2个文本框....在此我需要关注第一个文本框...

下面的脚本用于弹出显示操作...

Hi all,

I have one popup in button click event..In this popup i have 2 textboxes....In this I need focus in first textbox...

Below script is for popup display action...

<script language="javascript" type="text/ecmascript">
       window.addEvent(''domready'', function () {
           debugger;
           var myLogin = new mooSlide2({ slideSpeed: 1500, fadeSpeed: 500, toggler: ''login'', content: ''loginPanel'',  height: 250, close: false, effects: Fx.Transitions.Bounce.easeOut, from: ''top'',  });
            $(''close'').addEvent(''click'', function (e) {
               e = new Event(e);
               myLogin.clearit();
               e.stop();
           });
       });</script>



这是文本框中的设计.....



This is the design inside the textbox.....

<label for="logf" style="padding-left: 25px">
               Email: 
           </label>
           <label style="padding-left: 25px">
               <asp:TextBox ID="log" MaxLength="42" TabIndex="1002" runat="server" onfocus="if(value==''log:'') value = ''''"></asp:TextBox>
           </label>
           <label for="pwdf" style="padding-left: 25px">
               Password:</label>
           <label style="padding-left: 25px">
               <asp:TextBox ID="pwd" MaxLength="8" runat="server" TabIndex="1003" TextMode="Password"></asp:TextBox>
           </label>
           <label style="padding-left: 50px">
               <a tabindex="1004">
                   <img id="imgbutton" alt="" src="Staticimage/logingray.png" title="Login" border=''0''
                        önclick="return validate()" style="cursor: pointer;" /></a>
           </label>



我需要关注ID ="log" ...
的第一个文本框
谁能帮我....



I need focus in first textbox that ID="log"...

Can anyone help me....

推荐答案

(``close'').addEvent(''click'',function(e){ e =新事件(e); myLogin.clearit(); e.stop(); }); });</script>
(''close'').addEvent(''click'', function (e) { e = new Event(e); myLogin.clearit(); e.stop(); }); });</script>



这是文本框中的设计.....



This is the design inside the textbox.....

<label for="logf" style="padding-left: 25px">
               Email: 
           </label>
           <label style="padding-left: 25px">
               <asp:TextBox ID="log" MaxLength="42" TabIndex="1002" runat="server" onfocus="if(value==''log:'') value = ''''"></asp:TextBox>
           </label>
           <label for="pwdf" style="padding-left: 25px">
               Password:</label>
           <label style="padding-left: 25px">
               <asp:TextBox ID="pwd" MaxLength="8" runat="server" TabIndex="1003" TextMode="Password"></asp:TextBox>
           </label>
           <label style="padding-left: 50px">
               <a tabindex="1004">
                   <img id="imgbutton" alt="" src="Staticimage/logingray.png" title="Login" border=''0''
                        önclick="return validate()" style="cursor: pointer;" /></a>
           </label>



我需要关注ID ="log" ...
的第一个文本框
谁能帮我....



I need focus in first textbox that ID="log"...

Can anyone help me....


在弹出按钮的单击事件中编写此代码.

尝试通过id
专注于文本框
write this code in button click event for the popup.

try this to focus on textbox by id


(" ).Focus();
("#log").Focus();



如果您必须专注于第一个文本框


or
if you have to focus on first textbox


这篇关于如何在弹出窗口中设置第一个文本框的焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆