Gregor J. Rothfuss schrieb:
various templates have this warning:

<!-- N.B.: do not put spaces or carriage returns inside the
  textarea element - these would be rendered -->
<textarea name="description" class="lenya-form-element"><jx:out value="${request.getParameter('description')}"/></textarea>

unfortunately, all browsers i have tried cannot handle

<textarea/>

to prevent the serializer from collapsing <textarea> (and <script>),
there are 2 options:

* switch to the serializer from the serializers block
* add a space if the textarea value is empty

option 1 works, but that serializer has other problems that make the site area no longer work

Would it be possible to use one serializer for the site area, and the other for the remaining areas ?


so i added this stylesheet to strip_namespaces:

<xsl:template match="textarea|script|style">
  <xsl:element name="{local-name()}">
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
    <xsl:if test="string-length(.) = 0"><xsl:text> </xsl:text></xsl:if>
  </xsl:element>
</xsl:template>

i do not see a way around this, and google didn't have better ideas either. comments?

The problem is two-fold;
- usability: when the user gets a form with an empty text area, that area will always contain a space, so if she selects that field and starts typing, her text will have a space before it (that's why I removed the spaces in the XSL, I wasn't aware of this browser bug, I'm guessing it's an ... IE bug ?) - storage: the field gets stored even if the user put no meaningful value in it. We could of course check for that in the code.

Maybe another option would be (but you're probably not going to like this) to have browser-specific code. If we have workarounds in the stylesheets because of browser bugs anyway, we might as well make them explicit and have them applied only for the browser family requiring them.

--
Wolfgang


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to