Phone: (905) 704-1708   Toll-Free: 1 (855) 704-1708

WP Bottle Supply
jQuery("#ifgForm-747").validate({ rules: { "ifg-formfield-747-0":"required","ifg-formfield-747-1":"required","ifg-formfield-747-2":{required: true, email: true},"ifg-formfield-747-4":"required","ifg-formfield-747-10":"required","ifg-formfield-747-7":"required","captchaSolution":"required" }, messages: { "ifg-formfield-747-0": "This field is required.","ifg-formfield-747-1": "This field is required.","ifg-formfield-747-2": "Provide a valid email address.","ifg-formfield-747-4": "This field is required.","ifg-formfield-747-10": "This field is required.","ifg-formfield-747-7": "This field is required.","captchaSolution": "This field is required" }, errorElement: 'span', errorPlacement: function (error, element) { if (element.attr("type") == "checkbox") { error.insertAfter(jQuery(element).parents('div').prev(jQuery('.checkbox-question'))); } else { error.insertAfter(element); } }, errorClass: 'help-block', focusInvalid: true, ignore: "", invalidHandler: function (event, validator) { // Nix? }, highlight: function (element) { var form_id = jQuery(element).closest('form').attr('id'); var splitFormID = form_id.split("-"); var getFormID = splitFormID[1]; jQuery(element).closest('.form-group').addClass('has-error'); jQuery(element).closest('.form-group').find('.help-block').addClass('help-block-bg'); jQuery("#f1_upload_process-"+getFormID).hide(); jQuery(".event-submit-btn-"+getFormID).show(); }, unhighlight: function (element) { jQuery(element).closest('.form-group').removeClass('has-error'); jQuery(element).closest('.form-group').find('.help-block').removeClass('help-block-bg'); }, success: function (label) { label.closest('.form-group').removeClass('has-error'); }, submitHandler: function(form) { var has_selected_file; //jQuery('input[type=file]').filter(function() { jQuery('#upload_form-747').filter(function() { has_selected_file = true; }).length > 0 ; if (has_selected_file) { jQuery("#upload_form-747").submit(); } else{ ajaxSubmit(); } } }); submitClicked = function(generateRand) { window.globalVar = generateRand; jQuery("#f1_upload_process-"+globalVar).show(); jQuery("#f1_upload_process-"+globalVar+ " img").css({ 'border': '1px dotted rgb(204, 204, 204)', 'border-radius': '17px', 'background-color': '#ccc' }); jQuery(".event-submit-btn-"+generateRand).hide(); jQuery(".event-err").hide(); jQuery(".alert").remove(); jQuery("#ifgForm-"+generateRand).submit(); } selectUploadFile = function(generateRand,counter) { jQuery("#ifg-formfield-"+generateRand+"-file-"+counter).click(); } showFileNameSelected = function(generateRand,counter) { jQuery("#ifg-upload-"+generateRand+"-file-"+counter).html(jQuery("#ifg-formfield-"+generateRand+"-file-"+counter).val().split('\\').pop()); } ajaxSubmit = function() { var frmData = jQuery("#ifgForm-"+globalVar).serialize(); jQuery.ajax({ url: "/cmsi-data/formdata", data: frmData, type: "POST", async: false, dataType: "json", success:function(response) { jQuery("#f1_upload_process-"+globalVar).hide(); jQuery(".event-submit-btn-"+globalVar).show(); if (response.field_success == true) { var all_success = response.success; var displayAlert = true; if (typeof response.success_email != 'undefined' && response.success_email == true) { jQuery("#ifg-form-container").prepend(response.success_email_msg); } else if (typeof response.success_email != 'undefined' && response.success_email == false) { jQuery("#ifg-form-container").prepend(response.err_email_msg); all_success = false; } if (typeof response.success_action != 'undefined') { if (response.success_action == 'url-redirection' && typeof response.success_msg != 'undefined') { if (response.success_target == 'true') { jQuery("#ifgForm-"+globalVar).css("display","none"); jQuery(".event-submit-btn-"+globalVar).css("display","none"); jQuery("#ifgForm-"+globalVar).before("
Sent.
"); jQuery('html, body').animate({ scrollTop: jQuery(".alert").offset().top }, 500); window.open(response.success_msg, '_blank'); } else { displayAlert = false; window.location.href = response.success_msg; } } else if (response.success_action == 'custom-msg' && typeof response.success_msg != 'undefined') { jQuery("#ifgForm-"+globalVar).before(response.success_msg); } } if ( displayAlert ){ jQuery('html, body').animate({ scrollTop: jQuery(".alert").offset().top }, 500); } jQuery("#ifgForm-"+globalVar).css("display","none"); jQuery(".event-submit-btn-"+globalVar).css("display","none"); } else { jQuery.each(response.field_err, function(index, element){ jQuery("#"+element.field_name).after('
'+element.err+'
'); }); } }, error:function(xhr,err){ jQuery("#f1_upload_process-"+globalVar).hide(); jQuery(".event-submit-btn-"+globalVar).show(); } }); } });

-->