This is a used to filter some illegal characters on the client, you can prevent some unnecessary offers, but also appear user-friendly tips oh
JavaScript Tutorial filter Illegal character validator
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>javascript Filter Illegal character Verification program </title>
<script language= "JavaScript" >
function Encodeurl (str) {
var strurl=str.replace (/r/g, "%0a");
Strurl=strurl.replace (/n/g, "%0d");
Strurl=strurl.replace (/"/g", "%22");
Strurl=strurl.replace (/'/g, "%27");
return strurl;
}
function Check111net ()
{
var www111cnnet= $ (' 111cnNet '). Value;
Encodeurl (www111cnnet);
}
function $ (ID)
{
return document.getElementById (ID);
}
</script>
<body>
<form name= "Form1" method= "Post" action= "" >
<label>
<input type= "text" name= "TextField" id= "111cnNet" >
</label>
<p>
<label>
<input type= "Submit" name= "button" id= "button" value= "submitted" onclick= "Javascript:return check111net (); >
</label>
</p>
</form>
</body>