server.htmlencode / xhtml form problem
I am changing my site to validate as xhtml strict.
As part of this I am just revamping my forms.
I have a really irritating problem with Server.HTMLencode
If I can demonstrate.
Here are two pages:
old version (not xhtml)
new version (xhtml strict)
This page does not validate by the way, as I have hard coded some text in the <textarea> field for this demo.
Both pages are sending the form data to a page called 'send2'.
It takes the page data and does this with the 'recBody' form field:
strmsg = Server.HTMLencode(request("recBody"))
So, the problem:
When the non XHTML page sends the data, the output looks fine, as per the response.write on the 'send2.asp' page you can see on the demo.
When the XHTML page sends exactly the same data to exactly the same 'send2.asp' page the server.htmlencode has put in a load of gunk instead of meaningful data, as per the non xhtml demo page.
If anyone can give me any ideas about what is causing this I'd really appreciate it.