Hi a newbie to your forum and apoligise if I have post incorrectly.
As mentioned a newbie to xslt and could use some advice on how to get my xslt to work as I would like. What I am trying to schieve is this....I am using a chainedselect menu on a form with some javascript to call the required data into the comboboxs,plus also some
js getting called on window.onload, this all works fine. At present I am using two xsl's one for the window.onload and one for the combobox <select>. Now what I would really prefer is just one xslt to do the job for both, as each is using the same data in both, not sure or how to achieve this or if it is possible, I have provided the
js, xslt here for you to view, maybe someone with a better knowledge can point me correctly in the right direction.
Code:
<script type="text/javascript">function initAden() {initListGroup('chainedselects', document.Form1.box1, document.Form1.box2, '')} window.onload = initAden;</script>
Code:
<form name="Form1">
<select name="box1" class="box1"></select>
<select name="box2" class="box2" onchange="openLink(this.value)"></select>
</form>
Combobox xsl
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match='/'>
<xsl:for-each select="DATASET/ITEM">
<xsl:if test="NUMBEROFBOXES = '3'"> <!-- 3 boxes -->
<select name="{BOX1NAME}" class="{BOX1NAME}"></select>
<select name="{BOX2NAME}" class="{BOX2NAME}"></select>
<select name="{BOX3NAME}" class="{BOX3NAME}" onchange="openLink(this.value)"></select>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Window onload
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match='/'>
<xsl:for-each select="DATASET/ITEM">
<xsl:if test="NUMBEROFBOXES = '3'"> <!-- 3 boxes -->
<xsl:value-of select="FORMNAME"></xsl:value-of>.<xsl:value-of select="BOX1NAME"></xsl:value-of>, document.<xsl:value-of select="FORMNAME"></xsl:value-of>.<xsl:value-of select="BOX2NAME"></xsl:value-of>, document.<xsl:value-of select="FORMNAME"></xsl:value-of>.<xsl:value-of select="BOX3NAME"></xsl:value-of>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>