除了我所有的其他问题之外,我还会遇到一些奇怪的问题。我正在创建ASP.NET MVC应用程序。我正在使用flexigrid并试图使用Modal对话框。在IE浏览器中,Google Chrome和Opera I只能在客户端无法控制的情况下键入数字,但在FireFox中,我无法输入任何内容。无法在FireFox中输入任何内容
这是一个控制如何呈现:
<div id="add-edit-dialog" class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 0px; height: 622px;" scrolltop="0" scrollleft="0">
<form id="add-edit-form" novalidate="novalidate">
<fieldset>
<legend>Client Info</legend>
<input id="fntype" type="hidden" name="fntype" value="">
<input id="ClientId" type="hidden" value="" name="ClientId" data-val-number="The field ClientId must be a number." data-val="true">
<div class="editor-label" style="background-color: rgb(255, 255, 255);">
<div class="editor-field" style="background-color: rgb(255, 255, 255);">
<input id="ClientNumber" class="numericOnly input-validation-error" type="number" value="" name="ClientNumber" data-val-required="The Client No field is required." data-val-remote-url="/Client/doesClientNoExist" data-val-remote-type="POST" data-val-remote-additionalfields="*.ClientNumber,*.ClientId" data-val-remote="Client Number already exists. Please enter a different Client Number." data-val-number="The field Client No must be a number." data-val="true">
<span class="field-validation-error" data-valmsg-replace="true" data-valmsg-for="ClientNumber">
我用我自己的类numericOnly和类型号(显示为谷歌浏览器微调)。
我有CardNumbers.js文件,我定义numericOnly类是这样的:
$(".numericOnly").keypress(function (e) {
if (String.fromCharCode(e.keyCode).match(/[^0-9]/g)) return false;
});
上面,我发现前一阵子在的StackOverflow的问题之一,它在其他浏览器的工作原理确定的代码。
那么,你看这里有什么可能是错的,为什么我只能在FireFox中输入任何内容?
我将尝试您的代码,因为我注意到我的原始代码无法与TAB键一起工作我一直在测试一个小的test.html文件,它似乎工作好了在FireFox。我现在回到从我的应用程序 – Naomi
测试好吧,经过所有的变化,我完全打破了我的网站:( – Naomi
1.控制现在允许吨o输入任何内容(包括字母和数字),但网格不会显示在Google Chrome或FireFox中 – Naomi