输入密钥不起作用 [英] Enter key does not works

查看:51
本文介绍了输入密钥不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面中有两个链接按钮,其html代码如下所示

I have two link buttons in my page where its html code is as below

<div class="popup-style_menu">
                            <div class="popup-style_menu_btn">
                                <asp:LinkButton ID="lnkBtnStatusCancel" ValidationGroup="none" runat="server" onkeypress="Button_SpaceBar(event,this)"

                                    OnClick="lnkBtnStatusCancel_Click"><div class="cancel-button" TabIndex="5"><span>Cancel</span></div> </asp:LinkButton>
                            </div>
                            <div class="popup-style_menu_btn">
                                <asp:LinkButton ID="lnkBtnChangeStatus" ValidationGroup="required" runat="server"

                                    onkeypress="Button_SpaceBar(event,this)" OnClick="lnkBtnChangeStatus_Click"><div class="save-button" TabIndex="4">Save</div> 
                                </asp:LinkButton>
                            </div>
                        </div>





这里保存和取消只能击中空格键并且没有输入密钥。

我想在点击SPACEBAR和ENTER键时使用这些SAVE和CANCEL。

请帮我找到解决方案。



Here Save and Cancel works only hitting spacebar key and not working on enter key.
I want to work these SAVE and CANCEL on hitting both SPACEBAR and ENTER key.
Please help me to find a solution for this.

推荐答案

你必须使用面板控件来包装你的东西,并编程默认按钮,它必须在面板控件内。



你可以有几个面板,每个面板都有一个默认按钮。



有一个警告,指针必须在文本框中在面板中,默认按钮可以工作。



不像PHP,你可以在每个按钮周围包装表格标签。
You have to use the panel control to wrap your stuff in, and program the default button, which has to be inside the panel control.

You can have several panels, each with a default button.

There a caveat, the pointer has to be in the textbox within the panel for the default button to work.

Not like PHP where you wrap form tags around each button you want enter to work on.


这篇关于输入密钥不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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