PageSourceSearch

https://socotrapioneertours.com/wp-content/themes/socotra-pioneer-tours/assets/js/form-validation.js

js socotrapioneertours.com collected 2026-10-07 03:27:23 UTC 8,009 bytes, 262 lines download raw bytes

1function validateForm() {
2//    Name Validation
3    var name_regex = /^[a-zA-Z\s]*$/;
4    var name = $('#name').val();
5    if (!name.match(name_regex) || name.length == 0) {
6        $('#nameError').text("Only alphabets are allowed.."); // This Segment Displays The Validation Rule For Name
7//        $("#name").focus();
8        return false;
9    } else {
10        $('#nameError').text("");
11    }
12
13//Mobile  Number Validation
14    var phone_regex = /^(\+\d{1,3}[- ]?)?\d{10}$/;
15    var phone = $('#phone').val();
16
17    if (!phone.match(phone_regex) || phone.length == 0) {
18        $('#phoneError').text("Please enter valid Number.."); // This Segment Displays The Validation Rule For Phone Number
19//        $("#phone").focus();
20        return false;
21    } else {
22        $('#phoneError').text("");
23
24    }
25
26    var email_regex = /^\S+@(([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6})$/;
27    var email = $('#email').val();
28    if (!email.match(email_regex) || email.length == 0) {
29        $('#emailError').text("Please enter valid email.."); // This Segment Displays The Validation Rule For Email
30//        $("#email").focus();
31        return false;
32    } else {
33        $('#emailError').text("");
34    }
35
36    var msg = $('#message').val();
37    if (msg.length == 0) {
38        $('#messageError').text("Please Enter Message.."); // This Segment Displays The Validation Rule For Name
39//        $("#name").focus();
40        return false;
41    } else {
42        $('#messageError').text("");
43    }
44    var spinner = $('#loader');
45    spinner.show();
46
47}
48
49$("#name").blur(function () {
50    //    Name Validation
51    var name_regex = /^[a-zA-Z\s]*$/;
52    var name = $('#name').val();
53    if (!name.match(name_regex) || name.length == 0) {
54        $('#nameError').text("Only alphabets are allowed.."); // This Segment Displays The Validation Rule For Name
55//        $("#name").focus();
56        return false;
57    } else {
58        $('#nameError').text("");
59    }
60
61
62});
63
64$("#email").blur(function () {
65    //    Email Validation
66    var email_regex = /^\S+@(([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6})$/;
67    var email = $('#email').val();
68    if (!email.match(email_regex) || email.length == 0) {
69        $('#emailError').text("Please enter valid email.."); // This Segment Displays The Validation Rule For Email
70//        $("#email").focus();
71        return false;
72    } else {
73        $('#emailError').text("");
74    }
75
76});
77
78$("#phone").blur(function () {
79    var phone_regex = /^(\+\d{1,3}[- ]?)?\d{10}$/;
80    var phone = $('#phone').val();
81
82    if (!phone.match(phone_regex) || phone.length == 0) {
83        $('#phoneError').text("Please enter valid Number.."); // This Segment Displays The Validation Rule For Phone Number
84//        $("#phone").focus();
85        return false;
86    } else {
87        $('#phoneError').text("");
88
89    }
90});
91
92$("#message").blur(function () {
93    //    Name Validation
94
95    var msg = $('#message').val();
96    if (msg.length == 0) {
97        $('#messageError').text("Please Enter Message.."); // This Segment Displays The Validation Rule For Name
98//        $("#name").focus();
99        return false;
100    } else {
101        $('#messageError').text("");
102    }
103
104});
105
106function validateApplyForm() {
107    //    studentname Validation
108    var name_regex = /^[a-zA-Z\s]*$/;
109    var name = $('#studentname').val();
110    if (!name.match(name_regex) || name.length == 0) {
111        $('#studentnameError').text("Please Enter Your Name.."); // This Segment Displays The Validation Rule For Name
112//        $("#name").focus();
113        return false;
114    } else {
115        $('#studentnameError').text("");
116    }
117
118  
119    var name = $('#address').val();
120  if (city.length == 0) {
121        $('#address').text("Please Enter Address.."); // This Segment Displays The Validation Rule For Name
122//        $("#name").focus();
123        return false;
124    } else {
125        $('#addressError').text("");
126    }
127
128    //yourphone Validation
129    var phone_regex = /^(\+\d{1,3}[- ]?)?\d{10}$/;
130    var phone = $('#yourphone').val();
131
132    if (!phone.match(phone_regex) || phone.length == 0) {
133        $('#yourphoneError').text("Please enter valid Number.."); // This Segment Displays The Validation Rule For Phone Number
134//        $("#phone").focus();
135        return false;
136    } else {
137        $('#yourphoneError').text("");
138    }
139
140    var email_regex = /^\S+@(([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6})$/;
141    var email = $('#youremail').val();
142    if (!email.match(email_regex) || email.length == 0) {
143        $('#youremailError').text("Please enter valid email.."); // This Segment Displays The Validation Rule For Email
144//        $("#email").focus();
145        return false;
146    } else {
147        $('#youremailError').text("");
148    }
149
150    var city = $('#yourcity').val();
151    if (city.length == 0) {
152        $('#yourcityError').text("Please enter Your City Name.."); // This Segment Displays The Validation Rule For Email
153//        $("#email").focus();
154        return false;
155    } else {
156        $('#yourcityError').text("");
157    }
158
159  
160    //    School/College Validation
161
162    var city = $('#education').val();
163    if (city.length == 0) {
164        $('#schoolclgnameError').text("Please enter Your Education.."); // This Segment Displays The Validation Rule For Email
165//        $("#email").focus();
166        return false;
167    } else {
168        $('#schoolclgnameError').text("");
169    }
170
171
172
173
174
175}
176$("#studentname").blur(function () {
177    //    studentname Validation
178    var name_regex = /^[a-zA-Z\s]*$/;
179    var name = $('#studentname').val();
180    if (!name.match(name_regex) || name.length == 0) {
181        $('#studentnameError').text("Please Enter Your Name.."); // This Segment Displays The Validation Rule For Name
182//        $("#name").focus();
183        return false;
184    } else {
185        $('#studentnameError').text("");
186    }
187
188});
189
190
191$("#address").blur(function () {
192    //    studentname Validation
193 
194    var name = $('#address').val();
195    if (city.length == 0) {
196        $('#addressError').text("Please Enter Address.."); // This Segment Displays The Validation Rule For Name
197//        $("#name").focus();
198        return false;
199    } else {
200        $('#addressError').text("");
201    }
202
203});
204
205$("#yourphone").blur(function () {
206    //yourphone Validation
207    var phone_regex = /^(\+\d{1,3}[- ]?)?\d{10}$/;
208    var phone = $('#yourphone').val();
209
210    if (!phone.match(phone_regex) || phone.length == 0) {
211        $('#yourphoneError').text("Please enter valid Number.."); // This Segment Displays The Validation Rule For Phone Number
212//        $("#phone").focus();
213        return false;
214    } else {
215        $('#yourphoneError').text("");
216    }
217
218});
219
220$("#youremail").blur(function () {
221    //   youremail Validation
222    var email_regex = /^\S+@(([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6})$/;
223    var email = $('#youremail').val();
224    if (!email.match(email_regex) || email.length == 0) {
225        $('#youremailError').text("Please enter valid email.."); // This Segment Displays The Validation Rule For Email
226//        $("#email").focus();
227        return false;
228    } else {
229        $('#youremailError').text("");
230    }
231
232});
233
234$("#yourcity").blur(function () {
235    //   yourcity Validation
236//    var email_regex = /^\S+@(([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6})$/;
237    var city = $('#yourcity').val();
238    if (city.length == 0) {
239        $('#yourcityError').text("Please enter Your City Name.."); // This Segment Displays The Validation Rule For Email
240//        $("#email").focus();
241        return false;
242    } else {
243        $('#yourcityError').text("");
244    }
245
246});
247
248
249
250$("#education").blur(function () {
251    //    School/College Validation
252
253    var city = $('#education').val();
254    if (city.length == 0) {
255        $('#schoolclgnameError').text("Please enter Your Education.."); // This Segment Displays The Validation Rule For Email
256//        $("#email").focus();
257        return false;
258    } else {
259        $('#schoolclgnameError').text("");
260    }
261
262});

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.