html5 form validation modernizr safari

后端 未结 3 846
心在旅途
心在旅途 2021-01-05 12:19

this is the working example: http://jsfiddle.net/trustweb/sTSMW/

i notice an errore using safari 5.05

if i set a form as in an html5 page and i repleace th

3条回答
  •  太阳男子
    2021-01-05 12:24

    actually i did't find how to do just with modernizr, so i implemented this check:

    var browser=navigator.userAgent.toLowerCase();
    if (browser.indexOf("safari") != -1 && browser.indexOf("chrome") == -1) browser='safari';
    
    
    yepnope(
    {
        test : Modernizr.inputtypes.email && Modernizr.input.required && Modernizr.input.placeholder && browser!='safari',
        nope : 'javascript/webforms_home.js'
    });
    

提交回复
热议问题