PageSourceSearch

https://mycosphere.org/email/validation.js

js mycosphere.org collected 2026-10-02 07:47:25 UTC 910 bytes, 45 lines download raw bytes

1
2 function validation()
3 {
4    
5	var contactname=document.enq.name.value;
6	var name_exp=/^[A-Za-z\s]+$/;
7	if(contactname=='')
8	{
9		alert("Name Field Should Not Be Empty!");
10		document.enq.name.focus();
11		return false;
12	}
13	else if(!contactname.match(name_exp))
14	{
15		alert("Invalid Name field!");
16		document.enq.name.focus();
17		return false;
18	}
19	
20	var email=document.enq.email.value;
21	//var email_exp=/^[A-Za-z0-9\.-_\$]+@[A-Za-z]+\.[a-z]{2,4}$/;
22	var email_exp=/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
23	if(email=='')
24	{
25		alert("Please Enter Email-Id!");
26		document.enq.email.focus();
27		return false;
28	}
29	else if(!email.match(email_exp))
30	{
31		alert("Invalid Email ID !");
32		document.enq.email.focus();
33		return false;
34	}
35	
36	
37	var message=document.enq.message.value;
38	if(message=='')
39	{
40		alert("Query Field Should Not Be Empty!");
41		document.enq.message.focus();
42		return false;
43	}
44    return true;
45 }

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.