You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Wuebbelt <Pe...@Wuebbelt.de> on 2001/02/02 12:04:07 UTC

Stylesheet and JavaScript

I've got problems using Javascript in a stylesheet.

Using the "{" and "}" in the Javascript snippet below causes problems:

            <input type="text" name="ptno" size="10"
                     onblur="if( isPositiveInteger( this.value ) == false)  {
focus(); select() } " >
                   <xsl:attribute name="Value">
                          <xsl:value-of select="page/ptno"/>
                  </xsl:attribute>
            </input>

How to avoid it.
Thanks in advance

         Peter




Re: Stylesheet and JavaScript

Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
Symbols { and } have special meaning when used in attribute values.
Use {{ instead.
or change your code like this:

             <input type="text" name="ptno" size="10">
                    <xsl:attribute name="onblur">
                          if( isPositiveInteger( this.value ) == false)  {
 focus(); select() } "
                    </xsl:atribute>
                    <xsl:attribute name="Value">
                           <xsl:value-of select="page/ptno"/>
                   </xsl:attribute>
             </input>

Regards,
    Konstantin.

>
> I've got problems using Javascript in a stylesheet.
>
> Using the "{" and "}" in the Javascript snippet below causes problems:
>
>             <input type="text" name="ptno" size="10"
>                      onblur="if( isPositiveInteger( this.value ) == false)
{
> focus(); select() } " >
>                    <xsl:attribute name="Value">
>                           <xsl:value-of select="page/ptno"/>
>                   </xsl:attribute>
>             </input>
>
> How to avoid it.
> Thanks in advance
>
>          Peter
>
>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>