A
Andy B.
I have some TextBoxes that doesn't allow any html content. Was wondering how
you check to see if there is any?
you check to see if there is any?
Andy said:I have some TextBoxes that doesn't allow any html content. Was
wondering how you check to see if there is any?
Andrew Morton said:Presumably you are looking for anything that could be considered as html
markup rather than genuine html?
If there is no reason for "<" to appear in the text, perhaps you could
simply check for that character, otherwise you could encode the text so
that it is irrelevant if any html appears in it because you'll have
encoded it to <whatever> and so on.
You could even check for what key is being pressed and trap < so it can't
be entered in the first place, but you would also have to check for pasted
text containing a <.
If this is for an ASP.NET app, then do remember to check again
server-side.
Andrew
search for free text boxHas to be real html code. Anything fake is fine.