Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check Box

Status
Not open for further replies.

pielz

Programmer
Nov 12, 2002
8
US
Alright I'm trying to get the value back to test if the check box should be checked or not. I know i always get a true or false returned for my value. But having the check box show up checked or not is what i'm trying to get. So here's what i got so if you can help me thanks for your help.


<xsl:attribute name=&quot;value&quot;>
<xsl:value-of select=&quot;Savebox&quot;/>

<xsl:choose>

<xsl:when test=&quot;value='true'&quot;>
<input type=&quot;checkbox&quot; name=&quot;Savebox&quot;/>
</xsl:when>

<xsl:eek:therwise>
<input type=&quot;checkbox&quot; name=&quot;Savebox&quot;
checked=&quot;checked&quot;/>
</xsl:eek:therwise>

</xsl:choose>
</xsl:attribute>
 
The following code should do what you require, I wasnt sure whether the value was supposed to be a variable or an attribute so i made it into a variable if that makes sense:

<xsl:variable name=&quot;value&quot;>
<xsl:value-of select=&quot;Savebox&quot;/>
</xsl:variable>

<input>

<xsl:variable name=&quot;type&quot;>checkbox</xsl:variable>
<xsl:variable name=&quot;name&quot;>Savebox</xsl:variable>

<xsl:if test=&quot;$value ='true'>
<xsl:variable name=&quot;checked&quot;>checked</xsl:variable>
</xsl:if>

</input>

hope this helps!

Nick (Software Developer)


nick@retrographics.fsnet.co.uk
nick.price@myenable.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top