Hi Folks,
I have some XML which is basically an order header made up of several lines. in my XSL I am using the following code to flag any errors and create a hypertext link that will direct the user to the field in error:
<xsl:for-each select="/OrdLine/ord_no/error_message">
<LI>
<A name="pickup_sta" href="javascript:document.forms[0].pickup_sta.focus();">
<xsl:value-of select="."/>
</A>
</LI>
</xsl:for-each>
This give me the error message as a href and lets me click on it and go to the offending input on the form.
HOWEVER I cannot get this to work for the lines as there are a variable number of lines.
A friend of mine told me to try this:
<xsl:for-each select="Ord_head/ord_line">
<xsl:variable name="count">
<xsl:value-of select="position(Ord_head/ord_line)-1"/>
</xsl:variable>
<xsl:for-each select="ItemId/error_message">
<LI>
<A name="itemIdE__{$count}" href="javascript:document.forms[0].itemId__{$count}.focus();">
<xsl:value-of select="."/>
</A>
</LI>
</xsl:for-each>
</xsl:for-each>
This does not work. I get complaints about the javascript.
Can anybody help me please.
Cheers
Nosh
I have some XML which is basically an order header made up of several lines. in my XSL I am using the following code to flag any errors and create a hypertext link that will direct the user to the field in error:
<xsl:for-each select="/OrdLine/ord_no/error_message">
<LI>
<A name="pickup_sta" href="javascript:document.forms[0].pickup_sta.focus();">
<xsl:value-of select="."/>
</A>
</LI>
</xsl:for-each>
This give me the error message as a href and lets me click on it and go to the offending input on the form.
HOWEVER I cannot get this to work for the lines as there are a variable number of lines.
A friend of mine told me to try this:
<xsl:for-each select="Ord_head/ord_line">
<xsl:variable name="count">
<xsl:value-of select="position(Ord_head/ord_line)-1"/>
</xsl:variable>
<xsl:for-each select="ItemId/error_message">
<LI>
<A name="itemIdE__{$count}" href="javascript:document.forms[0].itemId__{$count}.focus();">
<xsl:value-of select="."/>
</A>
</LI>
</xsl:for-each>
</xsl:for-each>
This does not work. I get complaints about the javascript.
Can anybody help me please.
Cheers
Nosh