I am wondering if you can help me with a problem for javascript xhtml strict validation. There is a protocol when using strict XHTML that all javascript should be removed from the XHTML, and while we have done this for the majority of elements, almost every form the site has requires javascript inline. As an example, javascript uses the "&" character a lot, where as XML requires this to be "&", which we can not use in javascript. Any suggestions? 1) We can keep the site as Strict XHTML and validate everything BUT the javascript components, but this will result in lots of validation errors if tested. 2) We can validate only for XHTML transitional. This would allow for 100% validation.
You need to get rid of your inline usage of javascript and attach event listeners in an Init style loaded event handler. I switched to transitional and saved myself a ton of headaches in general, not just with JS.
If with inline you mean directly on the form elements or the form tag then no .. only the suggestion by joebert will do.. if how ever you mean that you have to define <script> tags in your source with the custom functions for each form then besides external files you could consider the CDATA section .. <script type="text/javascript"> <!--<![CDATA[ alert('test & test'); // this will validate because it is contained in the CDATA section and the parser ignores it ;) //]]>--> </script> HTML: but from your post i do not think that will do... had to post it though