HTML Editor tags left behind

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

HTML Editor tags left behind

bsteuhl
If you have content in textarea with attribute mediatype="text/html" and then you delete the text, the following tags are left behind <p> </p>.  I am evaluating whether textarea control is empty or not for required attribute and it works as long as no text is entered at first.  But when you delete the text, I do not get an validation error because the paragraph tag with one space is left behind.  I tried to add condition on required attribute of ...or instance('...')/fe:text = '<p> </p>' but this does not work.

Any suggestions on how to remove the html tags after someone deletes all of the text inside textarea or a way to account for this during validation?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: HTML Editor tags left behind

Erik Bruchez-3
This is tricky because the HTML is produced by the YUI RTE component
in combination with the browser (different browsers produce slightly
different HTML).

What might help is that our HTML control filters the resulting HTML
for security reasons (to prevent injections). This is done in this
transform:

http://github.com/orbeon/orbeon-forms/blob/master/src/resources-packaged/ops/xforms/clean-html.xsl

You might (or not) be able to fix this by changing this transform.

-Erik

On Wed, Dec 2, 2009 at 3:42 PM, bsteuhl <[hidden email]> wrote:

>
> If you have content in textarea with attribute mediatype="text/html" and then
> you delete the text, the following tags are left behind <p> </p>.  I am
> evaluating whether textarea control is empty or not for required attribute
> and it works as long as no text is entered at first.  But when you delete
> the text, I do not get an validation error because the paragraph tag with
> one space is left behind.  I tried to add condition on required attribute of
> ...or instance('...')/fe:text = '<p> </p>' but this does not
> work.
>
> Any suggestions on how to remove the html tags after someone deletes all of
> the text inside textarea or a way to account for this during validation?
>
> Thank you.
> --
> View this message in context: http://n4.nabble.com/HTML-Editor-tags-left-behind-tp947256p947256.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws