<script>
$(document).ready(function() {
$('#registered').bootstrapValidator({
container: '#messages',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
firstname: {
validators: {
notEmpty: {
message: 'First Name is required and cannot be empty'
},
stringLength: {
max: 30,
message: 'First name cannot be longer than 30 characters'
}
}
},
lastname: {
validators: {
notEmpty: {
message: 'Last Name is required and cannot be empty'
},
stringLength: {
max: 30,
message: 'Last name cannot be longer than 30 characters'
}
}
},
city: {
validators: {
notEmpty: {
message: 'City is required and cannot be empty'
},
stringLength: {
max: 30,
message: 'City cannot be longer than 30 characters'
}
}
},
state: {
validators: {
notEmpty: {
message: 'State is required and cannot be empty'
}
},
},
zip: {
validators: {
zipCode: {
country: 'US',
message: 'The zip is not valid US postal code'
},
notEmpty: {
message: 'Zip is required and cannot be empty'
},
stringLength: {
max: 10,
message: 'Zip cannot be longer than 10 characters'
}
},
},
mobile: {
validators: {
phone: {
country: 'US',
message: 'Mobile Phone is not valid US phone number'
},
notEmpty: {
message: 'Mobile Phone is required and cannot be empty'
},
stringLength: {
max: 12,
message: 'Mobile Phone cannot be longer than 12 characters'
}
}
},
home: {
validators: {
phone: {
country: 'US',
message: 'Home Phone is not valid US phone number'
},
stringLength: {
max: 12,
message: 'Home Phone cannot be longer than 12 characters'
}
}
},
password: {
validators: {
notEmpty: {
message: 'Password is required and cannot be empty'
},
stringLength: {
max: 8,
message: 'Password cannot be longer than 8 characters'
}
}
},
confirmpassword: {
validators: {
identical: {
field: 'password',
message: 'The password and the confirmation are not the same'
},
notEmpty: {
message: 'Confirm Password is required and cannot be empty'
},
stringLength: {
max: 8,
message: 'Confirm Password cannot be longer than 8 characters'
}
}
}
}
});