1jQuery(document).ready(function () { 2 if (jQuery.fn.select2) { 3 jQuery('#my-select2').select2(); 4 5 jQuery('#my-select2').on('select2:open', function () { 6 jQuery('.select2-dropdown').css({ 7 'max-height': '300px', 8 'overflow-y': 'auto' 9 }); 10 }); 11 } else { 12 console.error("Select2 is not loaded. Please ensure the library is included correctly."); 13 } 14 }); 15 16 17function sweet_alert(heading, message, alert_type) { 18 Swal.fire( 19 heading, 20 message, 21 alert_type 22 ); 23} 24function ValidateFormStarupSubmit(formclass, label = '') { 25 26 jQuery(document).off().on("submit", "." + formclass, function (e) { 27 document.querySelectorAll('.error').forEach(function(el) { 28 el.innerText = ''; 29 }); 30 e.preventDefault(); 31 var ajax_save_form = jQuery(this); 32 var formaction = ajax_save_form.attr('data-action'); 33 jQuery.ajax({ 34 enctype: 'multipart/form-data', 35 url: formaction, 36 data: new FormData(this), 37 method: 'post', 38 async: true, 39 dataType: 'json', 40 processData: false, 41 contentType: false, 42 cache: false, 43 timeout: 600000, 44 beforeSend: function() { 45 ajax_save_form.find(":submit").prop('disabled', true); 46 ajax_save_form.find(":submit").html('Processing please wait...'); 47 }, 48 success: function(response) { 49 ajax_save_form.find(":submit").prop('disabled', false); 50 ajax_save_form.find(":submit").html(label); 51 Swal.fire({ 52 title: '', 53 html: response.message, 54 icon: '',
55 showCancelButton: false, 56 confirmButtonText: 'Okay', 57 }).then((result) => { 58 if (result.isConfirmed) { 59 if (response.status) { 60 if (response.http_redirect) { 61 window.location.href = response.http_redirect; 62 } else { 63 window.location.reload(); 64 } 65 } 66 } 67 }); 68 } 69 }); 70 }); 71} 72 73function ValidateFormStarupSubmit_old(formclass, label = '') { 74 jQuery(document).off().on("submit", "." + formclass, function (e) { 75 document.querySelectorAll('.error').forEach(function(el) { 76 el.innerText = ''; 77 }); 78 e.preventDefault(); 79 var ajax_save_form = jQuery(this); 80 var formaction = ajax_save_form.attr('data-action'); 81 jQuery.ajax({ 82 enctype: 'multipart/form-data', 83 url: formaction, 84 data: new FormData(this), 85 method: 'post', 86 async: true, 87 dataType: 'json', 88 processData: false, 89 contentType: false, 90 cache: false, 91 timeout: 600000, 92 beforeSend: function() { 93 ajax_save_form.find(":submit").prop('disabled', true); 94 ajax_save_form.find(":submit").html('Processing please wait...'); 95 }, 96 success: function(response) { 97 ajax_save_form.find(":submit").prop('disabled', false); 98 ajax_save_form.find(":submit").html(label); 99 if (response.status) { 100 if (response.http_redirect) { 101 window.location.href = response.http_redirect; 102 } else { 103 window.location.reload(); 104 } 105 } else { 106 // Display error messages in SweetAlert 107 let errorMessages = ''; 108 for (let field in response.message) { 109 errorMessages += `<p>${response.message[field][0]}</p>`; 110 } 111 Swal.fire({ 112 icon: 'error', 113 title: 'Form Validation Error', 114 html: errorMessages, // Use HTML to render multiple lines 115 confirmButtonText: 'Ok' 116 }); 117 } 118 }, 119 error: function(xhr, status, error) { 120 Swal.fire({ 121 icon: 'error', 122 title: 'Submission Failed', 123 text: 'An error occurred while submitting the form. Please try again.', 124 confirmButtonText: 'Ok' 125 }); 126 ajax_save_form.find(":submit").prop('disabled', false); 127 ajax_save_form.find(":submit").html(label); 128 } 129 }); 130 }); 131} 132 133$(document).ready(function () { 134 jQuery.validator.addMethod("validMobile", function (value, element) { 135 // Regex to match 10-digit numbers starting with 6, 7, 8, or 9 136 return this.optional(element) || /^[6-9]\d{9}$/.test(value); 137 }, "Please enter a valid 10-digit mobile number"); 138 139 140 jQuery("#startupformstarted").validate({ 141 rules: { 142 contact_no: { 143 required: true, 144 validMobile: true 145 }, 146 grecaptcha: { 147 required: true, 148 } 149 } 150 }); 151}); 152function recaptchaCallback() { 153 var response = grecaptcha.getResponse(); 154 jQuery("#grecaptcha").val(response); 155} 156 157function recaptchaExpired() { 158 // jQuery("#grecaptcha").val(""); 159} 160 161 162 163jQuery(document).ready(function() { 164 jQuery('.search-single-select').select2(); 165}); 166 167function getcititlistdata(identifier) { 168 const stateid = jQuery(identifier).find(':selected').data('stateid');
169 const CurrentUrl = window.location.origin + '/startupddata/get-cities-list'; 170 jQuery.ajax({ 171 type: 'get', 172 url: CurrentUrl, 173 data: { 174 stateid: stateid 175 }, 176 beforeSend: function() { 177 jQuery(".citylistdatabox select").html('<option>Processing...</option>'); 178 }, 179 success: function (response) { 180 jQuery(".citylistdatabox select").html(response); 181 } 182 }); 183} 184function getcitiOtherdata(identifier) { 185 if (jQuery(identifier).val() == 'others') { 186 jQuery('.company_location_otherBox').show(); 187 jQuery('.company_location_otherBox input').addClass('required'); 188 } else { 189 jQuery('.company_location_otherBox').hide(); 190 //jQuery('.company_location_otherBox input').removeClass('required'); 191 } 192} 193function getreferralOtherdata(identifier) { 194 if (jQuery(identifier).val() == 'Other') { 195 jQuery('.referral_otherBox').show(); 196 jQuery('.referral_otherBox input').addClass('required'); 197 } else { 198 jQuery('.referral_otherBox').hide(); 199 } 200} 201function getlegalentityOtherdata(identifier) { 202 if (jQuery(identifier).val() == 'Other') { 203 jQuery('.legal_entity_otherBox').show(); 204 jQuery('.legal_entity_otherBox input').addClass('required'); 205 } else { 206 jQuery('.legal_entity_otherBox').hide(); 207 } 208}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.