PageSourceSearch

https://www.nic.ae//javascript/message_eng.js

js nic.ae collected 2026-10-02 12:00:13 UTC 20,662 bytes, 684 lines download raw bytes

1function checkAuthInfo() {
2	
3    if (document.searchform.authinfo != null && !document.searchform.authinfo.length){
4    	if (document.searchform.fullDomains.checked){
5	        if (document.searchform.authinfo.value==""){
6	            showerrormessage("Authorization Code cannot be empty!");
7	            return false;
8	        }
9	        if (document.searchform.authinfo.value.length<6){
10	            showerrormessage("Authorization Code must be at least 6 characters!");
11	            return false;
12	        }
13    	}
14    }
15
16	if (document.searchform.authinfo != null){        
17	    for (var i=0;i<document.searchform.authinfo.length;i++){
18	    	if (document.searchform.fullDomains[i].checked){
19		        if (document.searchform.authinfo[i].value==""){
20		            showerrormessage("Authorization Code cannot be empty!");
21		            return false;
22		        }
23		        if (document.searchform.authinfo[i].value.length<6){
24		            showerrormessage("Authorization Code must be at least 6 characters!")
25		            return false;
26		        }
27	    	}
28	    }
29    }
30
31    return checkDomains();
32}
33
34
35/*Create by Ikhmal: for Gtlds */
36function checkAuthInfo_addedforTransferIn(myCallback) {
37    var error = false;
38	event.preventDefault();
39	var domainArr = [];
40	var idxArr = [];
41
42	if (document.searchform.fullDomains == undefined){
43		showerrormessage("No domains selected / available!");
44		return false;
45	}
46    // Only 1
47    if (!document.searchform.fullDomains.length)
48    {
49        if (!document.searchform.fullDomains.checked)
50        {
51            showerrormessage("No domains selected / available!");
52            return false;
53        }
54        //check authinfo if available 
55        var domain = document.getElementById("fullDomains_verify").value;
56		var flow =document.getElementById("flowofevent_"+domain).value;
57		if (document.searchform.authinfo != null && !document.searchform.authinfo.length) {
58        	if (document.searchform.authinfo.value == "")
59        	{
60            	showerrormessage("Authorization Code cannot be empty!");
61				const element = document.getElementById('emptyFieldAlert');
62				element.scrollIntoView({ behavior: "smooth", block: "center" });
63            	return false;
64        	}
65        	if (document.searchform.authinfo.value.length < 6)
66        	{
67            	showerrormessage("Authorization Code must be at least 6 characters!");
68				const element = document.getElementById('emptyFieldAlert');
69				element.scrollIntoView({ behavior: "smooth", block: "center" });
70            	return false;
71        	}
72        	domainArr[0] = domain;
73        	idxArr[0] = 0;
74    	}
75    }
76    else
77    {
78        var atLeastOne = false;
79        for (i=0; i < document.searchform.fullDomains.length; i++)
80        {
81            if (document.searchform.fullDomains[i].checked){
82                atLeastOne = true;
83                var domain = document.searchform.fullDomains[i].value;
84				var flow =document.getElementById("flowofevent_"+domain).value;
85				//check authinfo for multiple selected domains if available
86				if (document.searchform.authinfo != null) {
87        			if (document.searchform.authinfo[i].value == "")
88        			{
89            			showerrormessage("Authorization Code cannot be empty!");
90						const element = document.getElementById('emptyFieldAlert');
91						element.scrollIntoView({ behavior: "smooth", block: "center" });
92            			return false;
93        			}
94        			if (document.searchform.authinfo[i].value.length < 6)
95        			{
96            			showerrormessage("Authorization Code must be at least 6 characters!");
97						const element = document.getElementById('emptyFieldAlert');
98						element.scrollIntoView({ behavior: "smooth", block: "center" });
99            			return false;
100        			}
101        			if(i==0 && domainArr[0] == null){
102	        			domainArr[0] = domain;
103        				idxArr[0] = 0;
104					}else if(i>0){
105						domainArr.push(domain);
106						idxArr.push(i);
107					}
108    			}
109            }
110        }
111        if (!atLeastOne)
112        {
113            showerrormessage("No domains selected / available!");
114            return false;
115        }
116    }
117	
118    if (error){
119        return false;
120	}	
121	else{
122		return myCallback(domainArr,idxArr);
123	}
124}
125
126function checkDomains() {
127	
128	var listcount=0;
129
130	// no results yet
131	if (document.searchform.fullDomains == undefined){
132		showerrormessage("No domains selected / available!");
133		return false;
134	}
135	// Only 1  
136    if (!document.searchform.fullDomains.length){
137        if (!document.searchform.fullDomains.checked){
138            showerrormessage("No domains selected / available!");
139            return false;
140        }else{
141			listcount=1;
142		}    
143    }
144    else{
145        var atLeastOne = false;
146        for (var i=0; i < document.searchform.fullDomains.length; i++){
147            if (document.searchform.fullDomains[i].checked)
148                atLeastOne = true;
149        }
150        if (!atLeastOne){
151            showerrormessage("No domains selected / available!");
152            return false;
153        }else{
154			listcount = document.searchform.fullDomains.length;
155		}
156    }
157    
158    
159    var extarr= new Array();
160	//If you are adding new extension notices, just add on below with false value
161    // whether to show extension notices
162    var showNotices = [
163	/* 0. abudhabi || ابوظبي    	*/	false, 
164	/* 1. arab & عرب  			*/	false, 
165	/* 2. travel				*/	false,
166	/* 3. jp					*/	false,
167	/* 4. hk					*/	false,
168	/* 5. net.hk				*/	false,
169	/* 6. kr & co.kr			*/	false,
170	/* 7. net.id				*/	false,
171	/* 8. co.id					*/	false,
172	/* 9. ca					*/	false,
173	/*10. gov.ae				*/	false,
174	/*11. mil.ae				*/	false,
175	/*12. net.ae				*/	false,
176	/*13. co.ae					*/  false,
177	/*14. org.ae				*/	false,
178	/*15. sch.ae				*/	false,
179	/*16. ac.ae					*/  false
180	]
181
182    for (var i=0; i < listcount; i++){
183	
184		var checked=false;
185		var extension="";
186		
187		if(listcount == 1){
188			checked = document.searchform.fullDomains.checked;
189			extension = document.searchform.fullDomains.value;
190			extension = extension.substring(extension.indexOf(".") + 1);
191		}else{
192			checked = document.searchform.fullDomains[i].checked;
193			extension = document.searchform.fullDomains[i].value;
194			extension = extension.substring(extension.indexOf(".") + 1);
195		}
196
197        if (checked){
198        	if(extension=='abudhabi' || extension=='ابوظبي'){
199        		showNotices[0] = true;
200        		extarr.push('abudhabi');
201        	}
202        	if (extension=='arab' || extension=='عرب'){
203        		showNotices[1] = true;
204        		extarr.push('arab');
205       		}
206       		if (extension=='travel'){
207       			showNotices[2] = true;
208       			extarr.push('travel');
209       		}
210       		if (extension=='jp') {
211				showNotices[3] = true;
212				extarr.push('jp');
213			}
214			if (extension=='hk') {
215				showNotices[4] = true;
216				extarr.push('hk');
217			}  
218			if (extension=='net.hk') {
219				showNotices[5] = true;
220				extarr.push('net.hk');
221			}
222			if (extension=='kr' || extension=='co.kr') {
223				showNotices[6] = true;
224				extarr.push('kr');
225			}
226			if (extension=='net.id') {
227				showNotices[7] = true;
228				extarr.push('net.id');
229			}
230			if (extension=='co.id') {
231				showNotices[8] = true;
232				extarr.push('co.id');
233			}
234			if (extension=='ca') {
235				showNotices[9] = true;
236				extarr.push('ca');
237			}
238			if (extension=='gov.ae') {
239				showNotices[10] = true;
240				extarr.push('gov.ae');
241			}
242			if (extension=='mil.ae') {
243				showNotices[11] = true;
244				extarr.push('mil.ae');
245			}
246			if (extension=='net.ae') {
247				showNotices[12] = true;
248				extarr.push('net.ae');
249			}
250			if (extension=='co.ae') {
251				showNotices[13] = true;
252				extarr.push('co.ae');
253			}
254			if (extension=='org.ae') {
255				showNotices[14] = true;
256				extarr.push('org.ae');
257			}
258			if (extension=='sch.ae') {
259				showNotices[15] = true;
260				extarr.push('sch.ae');
261			}
262			if (extension=='ac.ae') {
263				showNotices[16] = true;
264				extarr.push('ac.ae');
265			}
266       }
267    }
268       
269    var noticesResponse = true;
270
271	if(extarr.length>0){
272		noticesResponse = on(extarr);
273	}
274
275    return noticesResponse;
276}
277
278function on(extarr) {
279	document.getElementById("overlay-general").style.display = "block";
280	for(var i=0;i<extarr.length;i++){
281		document.getElementById("afterNotice").append(document.getElementById(extarr[i]));
282		document.getElementById(extarr[i]).style.display = "block";
283	}
284	document.documentElement.style.overflow = 'hidden';
285	document.body.scroll = "no";
286	return false;
287}
288
289function proceed(checkout) {
290	document.getElementById("overlay-general").style.display = "none";
291	return true;
292}
293
294function off(notice) {
295	document.getElementById("overlay-general").style.display = "none";
296	document.documentElement.style.overflow = 'scroll';
297	document.body.scroll = "yes";
298}
299
300function checkBulkDomain() {
301	var input = document.getElementById('bulkDomains').value;
302	var splitArray = input.split(/\r?\n/);
303	for(var i = 0; i < splitArray.length; i++) {
304		if (!checkDomainNameValid(splitArray[i])){
305			return false;
306		}
307	}
308	
309	return true;
310}
311
312function checkBulkDomain2() {
313	var input = document.getElementById('bulkdomain').value;
314	var splitArray = input.split(/\r?\n/);
315	for(var i = 0; i < splitArray.length; i++) {
316		if (!checkDomainNameValid(splitArray[i])){
317			return false;
318		}
319	}
320	
321	return true;
322}
323function checkBulkTransDom() {
324	var input = document.getElementById('bulkDomains').value;
325	var splitArray = input.split(/\r?\n/);
326	for(var i = 0; i < splitArray.length; i++) {
327		var splitAuthinfo = splitArray[i].split(',');
328		if (!checkDomainNameValid(splitAuthinfo[0])){
329			return false;
330		}
331	}
332	
333	return true;
334}
335
336function checkEmptyDomain() {
337	//change domain. to document.getElementById('domains')
338	var input = document.getElementById('domains').value.replace(/\s+/g, ' ');
339	
340	if (!checkDomainNameValid2(input)){
341		return false;
342	}
343	
344	//Check count for checked check box
345	var array = document.getElementsByName('selectedExtensions');
346	var fulldomains = document.getElementsByName('fullDomains');
347	
348	no_selection = 0;
349	fulldomain_no_selection = 0;
350		
351	//Count selected ext's checkbox
352	for (i = 0; i < array.length; i++) {
353		if (array[i].checked == true) {
354			no_selection = no_selection + 1;
355		}
356	}
357	
358	//Count full domain's checkbox
359	for (i = 0; i < fulldomains.length; i++) {
360		if (fulldomains[i].checked == true) {
361			fulldomain_no_selection = fulldomain_no_selection + 1;
362		}
363	}
364	
365//	for (i = 0; i < array.length; i++) {
366//		if (array[i].checked == true) {
367//			return true;
368//		}
369//	}
370//	alert("You didn't select  a domain name extension (.ae or .co.ae etc.). Please select at least one extension and then click search.");
371//	return false;
372	
373	return true;
374}
375
376function checkEmptyDomainSide() {
377	//change domain. to document.getElementById('domains')
378	var input = document.getElementById('sideDomain').value.replace(/\s+/g, ' ');
379
380	if (!checkDomainNameValid2(input)){
381		return false;
382	}
383	
384	//Check count for checked check box
385	var array = document.getElementsByName('selectedExtensions');
386	
387	var no_selection = 0;
388		
389	//Count selected ext's checkbox
390	for (i = 0; i < array.length; i++) {
391		if (array[i].checked == true) {
392			no_selection = no_selection + 1;
393		}
394	}
395	
396//	if (no_selection != 0) {
397//		return true;
398//	}
399//	else{
400//		alert("You didn't select  a domain name extension (.ae or .co.ae etc.). Please select at least one extension and then click search.");
401//		return false;
402//	}
403	
404	return true;
405}
406
407function checkEmptyDomainNew() {
408	//change domain. to document.getElementById('domains')
409	var input = document.getElementById('domains').value.replace(/\s+/g, ' ');
410	if (!checkDomainNameValid2(input)){
411		return false;
412	}
413	
414	return true;
415}
416
417function checkEmptyDomainAllTLD() {
418	//change domain. to document.getElementById('domains')
419	var input = document.getElementById('allTLDDomain').value.replace(/\s+/g, ' ');
420
421	if (!checkDomainNameValid2(input)){
422		return false;
423	}
424	
425	return true;
426}
427
428function checkDomainNameValid(input) {
429	if (input==null || input==" ") {
430		alert("You didn't enter a domain name.  Please enter a domain name and select at least one extension and then click SEARCH.");
431		return false;
432	}
433	
434	if (input.match(/[,\/+#!$@%\^&\*;:{}=\\_|<>\"\'\`~()]/g))
435	{
436		alert("The domain name you entered has invalid characters. A domain name can only consist of alphabets, numerals and a hyphen, no other special characters are allowed. Please enter a valid domain name.");
437		return false;
438	}
439	
440	if (input.indexOf(' ') != -1) {
441		alert("System restricts domain name which contains empty space(s).");
442		return false;
443	}
444	
445	if (input.lastIndexOf(".", 0) === 0 || input.lastIndexOf(".") === input.length - 1 || input.lastIndexOf("..") != -1){
446		alert("System restricts domain name which starts or ends with a period. Consecutive periods are not allowed.");
447		return false;
448	}
449	
450	//if (currentDom.indexOf('--') == 2) {
451	//	alert('System restricts domain name which contain a dash in the third and fourth positions.');
452	//	return false;
453	//} 
454	
455	//if (currentDom.indexOf('-') == 0|| currentDom.lastIndexOf('-') == currentDom.length - 1) {
456	//	alert('System restricts domain name which contain a dash in the begin and the end.');
457	//	return false;
458	//}
459	
460	return true;
461}
462
463function checkDomainNameValid2(input) {
464	if (input==null || input==" " || input=="Example: etisalat") {
465		alert("Please enter a valid domain name.");
466		return false;
467	}
468	
469//	if (input.match(/([\040])/g)){
470//		alert("System restricts domain name which contains empty space(s).");
471//		return false;
472//	}
473	
474	if (input.match(/([\041-\054])|([\057])|([\072-\077])|([\072-\077])|([\100])|([\133-\140])|([\173-\176])/g)){
475		alert("The domain name you entered has invalid characters. A domain name can only consist of alphabets, numerals and a hyphen, no other special characters are allowed. Please enter a valid domain name.");
476		return false;
477	}
478	
479//	if (input.lastIndexOf(".", 0) === 0 || input.lastIndexOf(".") === input.length - 1 || input.lastIndexOf("..") != -1){
480//		alert("System restricts domain name which starts or ends with a period. Consecutive periods are not allowed.");
481//		return false;
482//	}
483	
484	//if (input.indexOf('--') == 2) {
485	//	alert('System restricts domain name which contain a dash in the third and fourth positions.');
486	//	return false;
487	//} 
488	
489	//if (input.indexOf('-') == 0|| input.lastIndexOf('-') == input.length - 1) {
490	//	alert('System restricts domain name which contain a dash in the begin and the end.');
491	//	return false;
492	//}
493	
494	return true;
495}
496
497function checkDomainNameValidNoAlert(input){
498	if (input==null || input==" ") {
499		return false;
500	}
501	
502	if (input.match(/([\040])/g)){
503		return false;
504	}
505	
506	if (input.match(/([\041-\054])|([\057])|([\072-\077])|([\072-\077])|([\100])|([\133-\140])|([\173-\176])/g)){
507		return false;
508	}
509	
510	if (!input.match(/^[a-zA-Z0-9-.\u0621-\u064A\u0660-\u0669\u0030-\u0039\u002D-\u002E]+$/)){
511		return false;
512	}
513	
514	if (input.lastIndexOf(".", 0) === 0 || input.lastIndexOf(".") === input.length - 1 || input.lastIndexOf("..") != -1){
515		return false;
516	}
517	
518	if (input.indexOf('--') == 2) {
519		return false;
520	} 
521	
522	if (input.indexOf('-') == 0|| input.lastIndexOf('-') == input.length - 1) {
523		return false;
524	}
525	
526	return true;
527}
528
529function checkItems() {
530	var array = document.getElementsByName('item');
531	for (i = 0; i < array.length; i++) {
532		if (array[i].checked == true) {
533			return true;
534		}
535	}
536	showerrormessage("Please select at least one item to checkout!");
537	return false;
538}
539
540function checkExtensions() {
541	var array = document.getElementsByName('selectedExtensions');
542	no_selection = 0;
543	for (i = 0; i < array.length; i++) {
544		if (array[i].checked == true) {
545			no_selection = no_selection + 1;
546		}
547	}
548	for (i = 0; i < array.length; i++) {
549		if (array[i].checked == true) {
550			return true;
551		}
552	}
553	alert("You didn't select any extensions.");
554	return false;
555}
556
557function checkItemsSelected() {
558	var array = document.getElementsByName('item');
559	for (i = 0; i < array.length; i++) {
560		if (array[i].checked == true) {
561			return true;
562		}
563	}
564	alert("You didn't select any items.");
565	return false;
566}
567
568function checkAgree() {
569	var countCheck = 0;
570	
571	setTimeout(function() {
572		document.getElementById('addValueServicesToCart').setAttribute('style', 'pointer-events:none;');
573		document.getElementById('paymentspinnerdiv').style.display = "block";
574	},0);
575	
576	document.getElementById('textchange').innerHTML = "<i class='fas fa-spinner fa-spin'></i> Processing";
577	document.getElementById('agreement').setAttribute('disabled', 'disabled');
578	document.getElementById('thebutton').setAttribute('disabled', 'disabled');
579	
580	try {
581	    if (!document.getElementById('paymentOP_offline').checked) {
582	    	try{
583		    	if(!document.getElementById('paymentOP_tld').checked){
584		    		countCheck++;
585			    	alert("Please select payment option");
586			    	
587			    	document.getElementById('textchange').innerHTML = "Proceed";
588			    	document.getElementById('agreement').disabled = false;
589			    	document.getElementById('thebutton').disabled = false;
590			    	
591			        return false;
592		    	}
593	    	}catch (err){
594	    	}
595	    	
596	    	try{
597		    	if(!document.getElementById('paymentOP_online').checked){
598		    		countCheck++;
599			    	alert("Please select payment option");
600			    	
601			    	document.getElementById('textchange').innerHTML = "Proceed";
602			    	document.getElementById('agreement').disabled = false;
603			    	document.getElementById('thebutton').disabled = false;
604			    	
605			        return false;
606		    	}
607	    	}catch (err){
608	    	}
609	    }
610    
611		if (!document.getElementById('agreement').checked) {
612			countCheck++;
613	        alert("Please read the terms and conditions carefully, if you agree then check the box to continue");
614	        
615	        document.getElementById('textchange').innerHTML = "Proceed";
616	    	document.getElementById('agreement').disabled = false;
617	    	document.getElementById('thebutton').disabled = false;
618	    	
619	        return false;
620	    }
621	} catch(err) {
622		alert(err);
623		
624		document.getElementById('textchange').innerHTML = "Proceed";
625    	document.getElementById('agreement').disabled = false;
626    	document.getElementById('thebutton').disabled = false;
627	}
628	
629	//alert("countCheck : " + countCheck)
630	
631	if(countCheck === 0) {
632		( function($) {
633			// we can now rely on $ within the safety of our "bodyguard" function
634			$(document).ready( function() {
635
636				$("form[name='paymentForm']").submit(function() {
637
638					var v_paymentOP_tld = document.getElementById('paymentOP_tld');
639					if (v_paymentOP_tld === null) {
640						//alert('paymentOP_tld does not exist!');
641					} else {					
642						if (document.getElementById('paymentOP_tld').checked) {
643							//var v_paymentOP_tldValue = v_paymentOP_tld.value;
644							//alert('paymentOP_tld ' + v_paymentOP_tldValue);
645						} else {
646							document.getElementById('paymentOP_tld').setAttribute('disabled', 'disabled');
647						}						
648					}				
649
650					var v_paymentOP_online = document.getElementById('paymentOP_online');
651					if (v_paymentOP_online === null) {
652						//alert('paymentOP_online does not exist!');
653					} else {												
654						if (document.getElementById('paymentOP_online').checked) {
655							//var v_paymentOP_onlineValue = v_paymentOP_online.value;
656							//alert('paymentOP_online ' + v_paymentOP_onlineValue);
657						} else {
658							document.getElementById('paymentOP_online').setAttribute('disabled', 'disabled');
659						}
660					}
661
662					var v_paymentOP_offline = document.getElementById('paymentOP_offline');
663					if (v_paymentOP_offline === null) {
664						//alert('paymentOP_offline does not exist!');
665					} else {						
666						if (document.getElementById('paymentOP_offline').checked) {
667							//var v_paymentOP_offlineValue = v_paymentOP_offline.value;
668							//alert('paymentOP_offline ' + v_paymentOP_offlineValue);
669						} else {
670							document.getElementById('paymentOP_offline').setAttribute('disabled', 'disabled');
671						}
672					}
673				});
674			} );
675		} ) ( jQuery );
676	}
677
678	return checkEmptyDomain();
679}
680
681function checkoutError() {
682    alert("There are errors in your shopping cart. Please kindly rectify the errors and try again.");
683    return false;
684}

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.