Crops

dq

Oct 3rd, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1.  
  2. $('#nueva-orden')
  3. .formValidation({
  4. framework: 'bootstrap',
  5. fields: {
  6. tOrden: {
  7. validators: {
  8. notEmpty: {
  9. message: 'Se requiere de un tipo de orden.'
  10. }
  11. }
  12. },
  13. jAsignado: {
  14. validators: {
  15. notEmpty: {
  16. message: 'Se requiere asignar un jefe de mantenimiento.'
  17. }
  18. }
  19. },
  20. nMatricula: {
  21. validators: {
  22. notEmpty: {
  23. message: 'Se requiere de un número de matricula.'
  24. },
  25. stringLength: {
  26. min: 7,
  27. message: 'No parece ser un número de matricula.'
  28. }
  29. }
  30. },
  31. motivo: {
  32. validators: {
  33. notEmpty: {
  34. message: 'Motivo por el cual se creara la orden.'
  35. },
  36. stringLength: {
  37. min: 20,
  38. max: 200,
  39. message: 'Minimo 20 caracteres, Máximo 200.'
  40. }
  41. }
  42. },
  43. pMaximo: {
  44. validators: {
  45. notEmpty: {
  46. message: 'Plazo máximo para la entrega de la orden.'
  47. },
  48. date: {
  49. format: 'DD/MM/YYYY',
  50. message: 'La fecha no tiene un formato valido.'
  51. }
  52. }
  53. }
  54. }
  55. })
  56. .on('success.form.fv', function(e){
  57. e.preventDefault();
  58. var $form = $(e.target);
  59. var fv = $form.data('formValidation');
  60.  
  61. // aquí va la alerta.
  62. // Cuando se confirme se debe ejecutar fv.defaultSubmit();
  63. });
Advertisement
Add Comment
Please, Sign In to add comment