Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getUrlLanguage() {
- var urlPath = jQuery(location).attr('pathname');
- if (!urlPath) {
- return 'en';
- }
- var tokens = urlPath.toString().split("/");
- return tokens [1];
- }
- ;
- jQuery.fn.exists = function () {
- return this.length !== 0;
- };
- jQuery.fn.once = function (a, b) {
- return this.each(function () {
- jQuery(this).off(a).on(a, b);
- });
- };
- jQuery.validator.addMethod("isEmailValid", function (value) {
- var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
- return re.test(value);
- }, getUrlLanguage() == 'en' ? "Invalid email" : "E-mail inválido");
- jQuery.validator.addMethod("fuckSake", function (value) {
- return false;
- }, getUrlLanguage() == 'en' ? "Invalid email" : "E-mail inválido");
- /*jQuery.validator.addMethod('PhoneNumberValidLength', function (value) {
- var cleanValue = jQuery.trim(value);
- if (cleanValue == '') {
- return true;
- }
- if (cleanValue.toString().length >= 7 && (cleanValue > 0) && (value == parseInt(value, 10))) {
- return true;
- }
- return false;
- }, getUrlLanguage() == 'en' ? "Phone number must be at least 7 digits long. If required please add country code without '+'":
- "Su número de teléfono debe contener al menos 7 dígitos. Puede añadir el código del país sin '+'");*/
- var validationObject = {
- ignore: [],
- errorClass: 'mod_generalPaymentsError',
- rules: {
- first_name: {
- required: true
- },
- last_name: {
- required: true
- },
- email: {
- required: true,
- isEmailValid: true
- },
- phone: {
- required: true,
- fuckSake: true
- },
- totalPrice: {
- required: true
- },
- resourceDepartureDate: {
- required: true
- }
- },
- errorPlacement: function (error, element) {
- error.insertBefore(element);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement