2017-01-23 3 views
0

Ich verwende Bootstrap-Validator für meine Formulare Validierungen. Ich bin mit dem Problem konfrontiert, dass der Safari-Browser automatisch abgeschlossen wird.Bootstrap-Validierung fehlgeschlagen für Autovervollständigung Safari-Browser

$('#registration_info_form').bootstrapValidator({ 
    message: 'This value is not valid', 
    feedbackIcons: { 
     valid: 'glyphicon glyphicon-ok', 
     invalid: 'glyphicon glyphicon-remove', 
     validating: 'glyphicon glyphicon-refresh' 
    }, 
    verbose: false, 
    fields: { 
     Name: { 
      message: 'Invalid format.', 
      validators: { 
       notEmpty: { 
        message: 'This field is required.' 
       }, 
       stringLength: { 
        min: 2, 
        max: 100, 
        message: 'Name should be between 2 and 100 characters.', 
       } 
      } 
     }, 
    } 
}); 

Ich war Problem für Mac Chrome Browser. Um dies zu beheben, habe ich folgenden Code hinzugefügt, der das Chrom-Problem gelöst hat.

$("#Name").change(function() { 
    $('#registration_info_form').bootstrapValidator('revalidateField', 'Name'); 
}); 

Aber jetzt habe ich Probleme für Mac Safari Browser. Jede Hilfe wird geschätzt. Danke im Voraus.

Antwort

0

Ich habe die Lösung :) bekam

ich Unschärfe Ereignis verwendet haben. Beim Unschärfe-Ereignis validiere ich erneut dasselbe Feld.

$("#Name").blur(function() { 
    $('#registration_info_form').bootstrapValidator('revalidateField', 'Name'); 
}); 
Verwandte Themen