Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#form-contacto").validate({
- rules:{
- tipo_documento: {
- required: true,
- },
- numero_documento: {
- required: true,
- },
- nombre: {
- required: true,
- },
- apellido_paterno: {
- required: true,
- },
- apellido_materno: {
- required: true,
- },
- email: {
- email: true,
- },
- ciudad: {
- required: function(){
- return !$("#pais").val() ? false : ($("#pais").val() != 'PE')
- },
- },
- departamento: {
- required: function(){
- return !$("#pais").val() ? false : ($("#pais").val() == 'PE')
- },
- },
- provincia: {
- required: function(){
- return !!$("#departamento").val();
- },
- },
- distrito: {
- required: function(){
- return !!$("#provincia").val();
- },
- },
- },
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement