Hi,
I'm not sure if this is a feature request or a bug. When using the javascript functionality, I'm trying to setup a field with an 'id' attribute.
Looking at the code this is only possible with the 'href_id' within the fieldspec's javascript definition. Unfortunately this only works with image/label controls.
I think the XSL template 'scripting_events' should also have the id attribute added to the list. This will give the ability to specify a unique id that can be used by the javascript DOM instead of having to iterate over very input field type to find the corresponding value.
So:
<xsl:template name="scripting_events">
<xsl:param name="item"/>
<!-- copy all attributes containing scripting events to the output document -->
<xsl:for-each select="$item/@onfocus|$item/@onblur|$item/@onselect|$item/@onchange
|$item/@onclick|$item/@ondblclick|$item/@onmousedown|$item/@onmouseup
|$item/@onmouseover|$item/@onmusemove|$item/@onmouseout
|$item/@onkeypress|$item/@onkydown|$item/@onkeyup
|$item/@show">
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:template>
Would become:
<xsl:template name="scripting_events">
<xsl:param name="item"/>
<!-- copy all attributes containing scripting events to the output document -->
<xsl:for-each select="$item/@onfocus|$item/@onblur|$item/@onselect|$item/@onchange
|$item/@onclick|$item/@ondblclick|$item/@onmousedown|$item/@onmouseup
|$item/@onmouseover|$item/@onmusemove|$item/@onmouseout
|$item/@onkeypress|$item/@onkydown|$item/@onkeyup|$item/@id
|$item/@show">
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:template>
Cheers,
Kyle Brost
----