cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nägeli Margrit <>
Subject RE: Pre-selected option in html form
Date Thu, 13 Jul 2000 13:20:47 GMT
Big thanks to everybody who suggested a solution.

With your help, I solved it like this:

      <select name="{@id}" size="1">
        <xsl:for-each select="pf:option">
          <option value="{@value}">
            <xsl:if test="@selected='yes'">
              <xsl:attribute name="selected"/>
            <xsl:value-of select="@value"/>

This assumes that one of the options in the xml has ...selected="yes"

btw, the useragents I know can't tell the difference between selected,
selected="yes" or selected="no" or selected=0 - whenever the word "selected"
shows up, it's done and the rest is ignored.

Thank you all


-----Original Message-----
From: Gabriel Le Van []
Sent: Thursday, July 13, 2000 2:14 PM
Subject: Re: Pre-selected option in html form

I use xsl:attibute to check a radio button :

    <INPUT type="radio" name="{$champ}" onclick="{$onclick}"
     <xsl:if test="$readonly='true' or $showonly='true'">
      <xsl:attribute name="readonly">true</xsl:attribute>
     <xsl:if test="$valeurChamp=$value">
      <xsl:attribute name="checked"/>
     <xsl:if test="$tabindex">
      <xsl:attribute name="tabindex"><xsl:value-of

-----Message d'origine-----
De : Nägeli Margrit <>
À : <>
Date : jeudi 13 juillet 2000 13:52
Objet : Pre-selected option in html form

>I realise that my question is not directly cocoon-related, but seeing there
>are so many xsl experts on this list, I just go ahead and ask it anyway.
>I write a <form> which has a <select> element which contains various
><option> elements. One of these options (depending on selections in other
>screens or db output) has to be pre-selected. In html, this is done by
>specifying the valueless attribute "selected".
>Valueless attributes are not allowed in xml, but the useragents cannot tell
>the difference between selected="yes" and selected="no" yet.
>Has anyone encountered and solved this problem?
>Thank you
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message