Textbox Validation Js

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Textbox Validation Js as PDF for free.

More details

  • Words: 361
  • Pages: 3
/****************************************************************/ /* ** ** does not contain single quotes, double space, <, > */ /****************************************************************/ function textboxvalidation(strfield) { var intct; var strkey; var strtext; strkey=strfield.value; for (intct = 0; intct < strkey.length; intct++) { if (strkey.charat(0)==" ") {

}

strtext = strkey.substring(1,strkey.length); strfield.value = strtext;

if(strkey.charat(0) == ".") { strtext = strkey.substring(1,strkey.length); strfield.value = strtext; }

if (strkey.charat(intct)=="'") { strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct + 1,strkey.length); strfield.value = strtext; } else if (strkey.charat(intct) == " ") {

1,strkey.length);

if (strkey.charat(intct -1 ) == " ") { strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct + strfield.value = strtext; } //checking for sender. if is email id or comfirmemail

then removing sapce.

if(strfield.id == "txtemail" || strfield.id ==

"txtconfirmemail")

{ 1,strkey.length); } }

strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct + strfield.value = strtext;

{

else if (strkey.charat(intct)==";") strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct +

1,strkey.length); } { 1,strkey.length); }

strfield.value = strtext; else if (strkey.charat(intct)==":") strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct + strfield.value = strtext;

else if (strkey.charat(intct)=="<") { strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct + 1,strkey.length); strfield.value = strtext; } else if (strkey.charat(intct)==">") { strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct + 1,strkey.length); strfield.value = strtext; } else if (strkey.charat(intct)=="!" || strkey.charat(intct)== "%" || strkey.charat(intct)== "#" || strkey.charat(intct)== "$" || strkey.charat(intct)== "^" || strkey.charat(intct)== "(" || strkey.charat(intct)== ")" || strkey.charat(intct)== "*" || strkey.charat(intct)== "&" || strkey.charat(intct) == "\\" ) { strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct + 1,strkey.length); strfield.value = strtext; } else if (strkey.charat(intct)=="+" || strkey.charat(intct)== "=" || strkey.charat(intct)== "_" || strkey.charat(intct)== "?" || strkey.charat(intct)== "'" || strkey.charat(intct)== "," || strkey.charat(intct)== "_" || strkey.charat(intct)=='"' || strkey.charat(intct) == ":" || strkey.charat(intct) == ";" ) { strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct + 1,strkey.length); strfield.value = strtext; } else if (strkey.charat(intct) == "@") {

if (strkey.charat(intct -1 ) == "@") {

strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct +

1,strkey.length);

strfield.value = strtext; } } else if (strkey.charat(intct) == ".") { if (strkey.charat(intct -1 ) == ".") { strtext = strkey.substring(0,intct); strtext = strtext + strkey.substring(intct + 1,strkey.length); } }

}

strfield.value = strtext; }

Related Documents

Textbox Validation Js
November 2019 5
Textbox
November 2019 5
Js
June 2020 31
Js
May 2020 34
Js
May 2020 22
Js
June 2020 21