validation on string
-
Hi all I need to validate a string to allow html or simple text but not script language means a textbox can accept bold, italic tag of html but not script tag like alert("hi"); how can i do this Any help would be appreciated..
Amit
-
Hi all I need to validate a string to allow html or simple text but not script language means a textbox can accept bold, italic tag of html but not script tag like alert("hi"); how can i do this Any help would be appreciated..
Amit
Just check the
<script
tag.if(txtBox.Text.Contains("<script")
//This text contains script.//Anurag Gandhi.
http://www.gandhisoft.com
Life is a computer program and every one is the programmer of his own life.
My latest article: Group GridView Data -
Just check the
<script
tag.if(txtBox.Text.Contains("<script")
//This text contains script.//Anurag Gandhi.
http://www.gandhisoft.com
Life is a computer program and every one is the programmer of his own life.
My latest article: Group GridView DataIt takes a bit more than that............ what about if the symbols are encoded, what about if the user puts whitespace between the symbol and the 's' there are various other things to think about. Search Google, there are various articles relating to Validating User Input and limited HTML; e.g. http://www.brainhandles.com/techno-thoughts/form-validation-php-html[^]
Dave Find Me On: Web|Facebook|Twitter|LinkedIn CPRepWatcher now available as Packaged Chrome Extension, visit my articles for link.