The required attribute of the input element is invalid. The required attribute of the input element is invalid.

Source: Internet
Author: User

The required attribute of the input element is invalid. The required attribute of the input element is invalid.

Solution from http://stackoverflow.com/questions/23261301/required-attribute-not-work-in-safari-browser

 

Safari does not support the required attribute of input, which can be solved by js.

1 $ (document ). ready (function () {2 $ ("form "). submit (function (e) {3 var ref = $ (this ). find ("[required = required]"); 4 alert ('ref '); 5 $ (ref ). each (function () {6 if ($ (this ). val () = '') 7 {8 alert (" Required field shocould not be blank. "); 9 $ (this ). focus (); 10 e. preventDefault (); 11 return false; 12} 13}); return true; 14}); 15 });

 

This article is original, reproduced please indicate the source: http://www.cnblogs.com/lawn-tiger/p/6346726.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.