[Home] [By Thread] [By Date] [Recent Entries]
----- Original Message -----
From: "Adrian Popescu" <adrian@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Tuesday, May 18, 2004 3:33 PM Subject: Re: XSL checkbox I am newbie in XSL and I search ALL GOOGLE for an example:(( As was said this seems more like an HTML question but you are using xsl:attribute incorrectly. The htnl you need is: <input type="checkbox" onclick="toggleColour(this);"> so your xsl should be (I haven't checked any other stuff): <INPUT> <xsl:attribute name="TYPE">checkbox</xsl:attribute> <xsl:attribute name="VALUE">c1</xsl:attribute> <xsl:attribute name="ONCLICK"> toggleColour(this); </xsl:attribute> <xsl:apply-templates/> Then output the following script block somewhere, as you have with your other block: <script> <![CDATA[ function toggleColour(Element)
{
if (Element.style.backgroundColor == "#ffff00"
{
Element.style.backgroundColor = "#ffffff";
}
else
{
Element.style.backgroundColor = "#ffff00";
}
}
]]>
</script>Now you could put that code into an inline event handler but it would be rather messy :) -- Joe
|

Cart



