久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 jQuery 驗證插件:onfocusout、onkeyup 在生產站點

Using jQuery validate plugin: onfocusout, onkeyup notworking as expected on production site(使用 jQuery 驗證插件:onfocusout、onkeyup 在生產站點上未按預期工作)
本文介紹了使用 jQuery 驗證插件:onfocusout、onkeyup 在生產站點上未按預期工作的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用 jQuery 驗證插件 v.1.9.0 它可以工作很友好地.但是我面臨這個問題,一旦用戶提交表單 &如果有任何錯誤,它會正確顯示錯誤消息.問題在于,如果用戶采取措施糾正該錯誤,它不會更新消息.例如.如果需要一個字段,則在第一次收到消息時,用戶開始輸入,然后該消息應該消失.

I am using jQuery Validate plugin v.1.9.0 it works very nicely. But I am facing this issue, once the user submits the form & if there are any errors, it correctly display error message. The problem is that it does not update the message if the user takes an action to remedy that error. E.g. if a field is required, upon getting the message the first time, user starts typing, then that message should go away.

在文檔中提到 onfocusout &onkeyup 用于此目的 &默認情況下,它們設置為 true.有趣的是,它似乎可以在我的本地工作站上運行,但是一旦我將代碼上傳到生產站點,它就會(默默地)失敗.我以為我以某種方式把它搞砸了,所以我啟動了 jsfiddle 并輸入了相關代碼 看看它是否也發生在那里.

In the docs it mentions that onfocusout & onkeyup are used for this purpose & by default they are set to true. The funny thing is it seems to work on my local workstation but it fails (silently) once I upload my code to production site. I thought I was messing it up royally somehow so I fired up jsfiddle and put relevant code to see if it happens there as well.

我很驚訝地看到它也發生在那里.所以我的問題是為什么它可以在我的本地機器上運行,但不能在生產站點上運行?

I was amazed to see it happens there as well. So my question is why does it work on my local machine but not on production sites?

附:http://jsfiddle.net/tankchintan/cge44/5/的獨立示例

更新

要復制問題,請執行 -

To replicate the issue, do -

  1. 轉到 jsfiddle 頁面.
  2. 無需填寫任何字段點擊提交表單.
  3. 它會在每個字段旁邊顯示錯誤消息.
  4. 現在開始在任一字段中輸入內容.
  5. 您會注意到,即使滿足規則,錯誤消息也不會消失.在我的本地機器上,一旦我在該字段中輸入任何內容,錯誤消息就會消失.

推薦答案

這個問題甚至在JQuery網站的一些例子中也存在.

This problem even exists in some of the examples on the JQuery website.

我發現當輸入元素沒有類型時會出現問題.如果未指定,Web 瀏覽器假定類型為文本",但 jquery.validate 存在問題.您的輸入元素應如下所示:

I found that the problem occurs when the input element has no type. Web browsers assume that the type is "text" if not specified, but jquery.validate has a problem with that. Your input element should look like this:

<input id="cname" name="name" type="text" class="required" minlength="2" />

這篇關于使用 jQuery 驗證插件:onfocusout、onkeyup 在生產站點上未按預期工作的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

jQuery/JavaScript Library for avatar creation?(用于創建頭像的 jQuery/JavaScript 庫?)
How to do following mask input problem?(如何做以下掩碼輸入問題?)
Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 設置值/標簽的問題)
how to unit-test private methods in jquery plugins?(如何對 jquery 插件中的私有方法進行單元測試?)
stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 為垂直滾動網站配置偏移量/對齊元素?)
jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽輸入插件.當文本框獲得焦點時選擇所有內容)
主站蜘蛛池模板: 国产精品美女在线观看 | 日韩影院一区 | 亚洲国产精品一区二区www | 91综合网 | 国产成人精品久久二区二区91 | 亚洲一区二区三区欧美 | av手机免费在线观看 | 免费网站国产 | 国产成人免费在线观看 | 欧美日韩免费视频 | 天天夜天天操 | 国产精品99免费视频 | 国产羞羞视频在线观看 | 一区二区久久 | 欧美一区二区三区在线观看 | www成年人视频 | 国产精品免费一区二区三区四区 | 亚洲精品日韩综合观看成人91 | 国产一区亚洲 | 精品欧美一区二区三区久久久小说 | 亚洲精品一二三区 | 久久久国产精品 | 成人精品鲁一区一区二区 | 久久精品视频在线播放 | 亚洲vs天堂 | 国产精品a久久久久 | 国产精品久久久久久亚洲调教 | 免费黄色a级毛片 | 天天av综合| 99re99| 狠狠干av | 久久久免费| 亚洲成av | 男女一区二区三区 | 女女百合av大片一区二区三区九县 | 国产片一区二区三区 | 一区在线免费视频 | 午夜视频一区二区 | 网站黄色在线免费观看 | 欧美一级片在线观看 | 欧美在线国产精品 |