|
Hi All,
When i am hitting Enter key after focused to a button with tab key , nothing is happening , but when i am hitting spacebar ,it is working (in Firefox) . What will be the issue . Please help
Thanks
Rks
|
|
|
|
|
You should ask this question to folks at Mozilla or at least add some code or link to demo AND version of browser.
No more Mister Nice Guy... >: |
|
|
|
|
|
<pre lang="HTML"> <span id="span3" class="cBtnLeft"><span class="cBtnRight">
<asp:Button ID="btnDupCheck" runat="server" OnClientClick="LoadingPanel.Show();"
OnClick="btnDupCheck_Click" Text="Next" CssClass="cBtnRight" Width="60px" TabIndex="11" UseSubmitBehavior="true"/>
</span></span><span id="span4" class="cBtnLeft"><span
class="cBtnRight">
<asp:Button ID="btnCncl" runat="server" Text="Cancel" OnClick="btnCncl_OnClick" OnClientClick="LoadingPanel.Show();"
CssClass="cBtnRight" Width="60px" TabIndex="12" />
These are the buttons and UseSubmitBehavior will not help . Firefox version is 16.0.2
</span></span>
|
|
|
|
|
Are you asking about using the enter button to submit a form?
If so, you have to wrap the area in a panel, and set the panels default button ID for submit. Then the content in that area, if the cursor is in the textbox, will fire the assigned button. If the cursor is not in a element within the panel, nothing will fire.
|
|
|
|
|
You can try this:
<script>
document.onkeydown=function(event)
{
e = event ? event :(window.event ? window.event : null);
if(e.keyCode==13){
//执行的方法
alert('回车检测到了');
}
}
</script>
Good luck.
|
|
|
|