breaststroke Posted March 28, 2011 Share Posted March 28, 2011 hELLO!I have a script in some files of my website to limit the number of lines in a textarea input.This is the script: script type="text/javascript">function validar(e,obj) { tecla = (document.all) ? e.keyCode : e.which; if (tecla != 13) return; filas = obj.rows; txt = obj.value.split('\n'); return (txt.length < 20);}</script> It works fine, but when it comes to validate those pages I get an error.It says something like: "invalid element name.." referring to "<" sign.I don't know what I can do to not get that error, using the same function or another similar.I would appreciate any suggestion.Thank you very much in advance.Regards! Link to comment Share on other sites More sharing options...
thescientist Posted March 28, 2011 Share Posted March 28, 2011 you could use cdata.http://www.w3schools.com/xml/xml_cdata.asp Link to comment Share on other sites More sharing options...
breaststroke Posted March 28, 2011 Author Share Posted March 28, 2011 hi,I think I am stunned. What a great solution, and good explanation in that link as well.Thank you very much, the scientist!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.