S
Simon
Hi,
I have a webapp that allows an HTML description for an object to be
saved. It used to be pure text with no formatting. This caused
problems if the user entered (for example) and iframe tag, etc.. I
rewrote the input form to use MSHTML and updates a hidden input with
the inner HTML of the IFrame when the iframe generates an onblur
event. This keeps the hidden input from the user, but is submitted
when the form is submitted. This works, and I have even written some
HTML normalise script to ensure that all attribute values have double
quotes around them. However, sometime it generates badly formed HTML
when I re-edit the data, eg:
<UL>
<LI>TEST</LI>
<LI>sd</LI>
<LI>sd</LI></UL>
changes to :
<UL>
<LI><STRONG>TEST</STRONG>
<LI>sd
<LI>sd</LI></UL>
if I select Test in the browser and make it Bold. I lose the </LI>
Can I assign a DTD to validate the IFrame Document so that this does
not arise, alteratively can I set up the MSHTML control so that it
does not create badly formed HTML?
I am new to MSHTML, so please bear with me ;-)
Thanks,
Simon
I have a webapp that allows an HTML description for an object to be
saved. It used to be pure text with no formatting. This caused
problems if the user entered (for example) and iframe tag, etc.. I
rewrote the input form to use MSHTML and updates a hidden input with
the inner HTML of the IFrame when the iframe generates an onblur
event. This keeps the hidden input from the user, but is submitted
when the form is submitted. This works, and I have even written some
HTML normalise script to ensure that all attribute values have double
quotes around them. However, sometime it generates badly formed HTML
when I re-edit the data, eg:
<UL>
<LI>TEST</LI>
<LI>sd</LI>
<LI>sd</LI></UL>
changes to :
<UL>
<LI><STRONG>TEST</STRONG>
<LI>sd
<LI>sd</LI></UL>
if I select Test in the browser and make it Bold. I lose the </LI>
Can I assign a DTD to validate the IFrame Document so that this does
not arise, alteratively can I set up the MSHTML control so that it
does not create badly formed HTML?
I am new to MSHTML, so please bear with me ;-)
Thanks,
Simon