views:

158

answers:

1

Hi, I need help please.

No clue in xml & WebtextEdit, I am editing an xslt stylesheet that creates asp controls.

Below is the WebTextEdit control, I want to add an mousemove event:

   <xsl:element name="igtxt:WebTextEdit">
        <xsl:attribute name='id'><xsl:value-of select='$Name' /></xsl:attribute>
        <xsl:attribute name='runat'>server</xsl:attribute> 
 <xsl:attribute name='Text'><xsl:value-of select='$Value' disable-output-escaping="yes" /></xsl:attribute>                                                      <xsl:attribute name='MouseMove'>"<xsl:value-of select='@name' />".style.color = '#006AB6';</xsl:attribute>
 <xsl:for-each select="$Attributes/Attribute">
          <xsl:if test=". != ''">
            <xsl:attribute name='{@name}'><xsl:value-of select='.' /></xsl:attribute>
          </xsl:if>
        </xsl:for-each>
        <xsl:copy-of select="$Events" />
      </xsl:element>

The code works to change the style as it works on other objects.

Please assist with how i can add a mouseover event to WebTextEdit control

+1  A: 

If you always want to run the same (static) JavaScript or dynamic JavaScript generated with XSLT, use the same method as is used to add the id, runat, and Text attributes:

<xsl:attribute name="mouseover">alert('test');</xsl:attribute>

If each control needs to execute different (static) JavaScript, just add an onmouseover attribute to the XML element that triggers this template. The loop will read any attributes in the XML element and pass them on to the generated markup.

Brandon Gano