model view controller - Bootstrap date picker field validation error wont disappear when selecting a date -
i'm new bootstrap validation , use help. using bootstrap date picker. here: http://eonasdan.github.io/bootstrap-datetimepicker/ datepicker4 context. below code i'm printing out input field , below jquery code using validate. know i'm doing wrong here don't know what. i'm trying validate based off of class here working text fields date picker not. appreciated!
@html.textboxfor(m => m.employment.currentemployer.starttimestamp, format: workhistoryviewmodel.format_dateonly, htmlattributes: new { @id = "datetimepicker4", @class = "sw form-control paydate", @maxlength = "40", @type = "text", @placeholder = "from" }) $(document).ready(function () { $('#datetimepicker4').datetimepicker({ picktime: false, format: 'mm-dd-yyyy' }); $('#contact_form').bootstrapvalidator({ feedbackicons: { //valid: 'glyphicon glyphicon-ok', //invalid: 'glyphicon glyphicon-remove', //validating: 'glyphicon glyphicon-refresh' }, fields: { secfullname: { validators: { notempty: { message: 'full name required' }, stringlength: { min: 6, max: 30, message: 'full name must more 6 , less 30 characters long' }, regexp: { regexp: /^[a-za-z,\s]+$/, message: 'full name can consist of alphabetical , spaces' } } }, floridawitnessname: { validators: { notempty: { message: 'full name required' }, stringlength: { min: 6, max: 30, message: 'full name must more 6 , less 30 characters long' }, regexp: { regexp: /^[a-za-z,\s]+$/, message: 'full name can consist of alphabetical , spaces' } } }, fullname: { validators: { notempty: { message: 'full name required' }, stringlength: { min: 6, max: 30, message: 'full name must more 6 , less 30 characters long' }, regexp: { regexp: /^[a-za-z,\s]+$/, message: 'full name can consist of alphabetical , spaces' } } }, floridafullname: { validators: { notempty: { message: 'full name required' }, stringlength: { min: 6, max: 30, message: 'full name must more 6 , less 30 characters long' }, regexp: { regexp: /^[a-za-z,\s]+$/, message: 'full name can consist of alphabetical , spaces' } } }, currentemployer: { validators: { stringlength: { min: 2, }, notempty: { message: 'please enter current employer' } } }, highschool: { selector: '.highschool', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter high school attended' } } }, recentemployer: { selector: '.recentemployer', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter current employer' } } }, supervisorname: { selector: '.supervisorname', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter current employer' } } }, supervisoremail: { selector: '.supervisoremail', validators: { notempty: { message: 'please enter supervisors email address' }, supemailaddress: { message: 'please supply valid email address' } } }, supervisorphone: { selector: '.supervisorphone', validators: { notempty: { message: 'please enter phone number' }, supphonenumber: { country: 'us', message: 'please supply vaild phone number area code' } } }, workresponsibilities: { selector: '.workresponsibilities', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter current job responsibilities' } } }, yearsexperience: { selector: '.yearsexperience', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter years attended' } } }, workingsw: { selector: '.workingsw', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter why work @ speakwrite' } } }, years: { selector: '.years', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter years attended' } } }, degree: { selector: '.degree', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter degree received' } } }, firstname: { selector: '.firstname', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter first name' } } }, lastname: { selector: '.lastname', validators: { stringlength: { min: 2, }, notempty: { message: 'please enter last name' } } }, email: { selector: '.email', validators: { notempty: { message: 'please enter email address' }, emailaddress: { message: 'please supply valid email address' } } }, confirmemail: { selector: '.confirmemail', validators: { notempty: { message: 'please confirm email address' }, confirmemailaddress: { message: 'please supply valid email address' } } }, phone: { selector: '.phone', validators: { notempty: { message: 'please enter phone number' }, phonenumber: { country: 'us', message: 'please supply vaild phone number area code' } } }, password: { selector: '.password', validators: { notempty: { message: 'the password required , can\'t empty' }, yourpassword: { message: 'the password required , can\'t empty' } } }, graduate: { selector: '.graduate', validators: { notempty: { message: 'please check box have graduated' } } }, contactyes: { selector: '.contactyes', validators: { notempty: { message: 'please choose contacted ' } } }, agree: { validators: { notempty: { message: 'please check box agree have read form' } } }, agree2: { validators: { notempty: { message: 'please check box agree have read form' } } }, agree3: { validators: { notempty: { message: 'please check box agree have read form' } } }, paydate: { selector: '.paydate', validators: { date: { format: 'mm-dd-yyyy', message: 'the format dd/mm/yyyy' }, notempty: { message: 'the field can not empty' } } } } }) .on('success.form.bv', function (e) { $('#success_message').slidedown({ opacity: "show" }, "slow"); $('#contact_form').data('bootstrapvalidator').resetform(); // prevent form submission e.preventdefault(); // form instance var $form = $(e.target); // bootstrapvalidator instance //var bv = $form.data('bootstrapvalidator'); // use ajax submit form data $.post($form.attr('action'), $form.serialize(), function (result) { console.log(result); }, 'json'); }); // bootstrap css not account checkboxes generated asp.net-mvc. // bootsrap require input of type="checkbox" right next span. code allows happen. $(function () { $('input[type=checkbox],input[type=radio]').after('<span class="wbox" />'); }); //preloader passed typing test $(window).load(function () { //show(); }); function show() { $('.se-pre-con').hide(); $('.loadcontent').fadein(); }; settimeout(show, 3000); });
Comments
Post a Comment