mili
07-12-2003, 03:54 PM
Hi,
I have a table with a bunch of rows and each row represents a record from the database table. Each row, is wrapped in a <form>.
On every row, I have a hyperlink that takes me to another page with details.I'm trying to pass the the variable recId, so that I can view the respective record details from the hyperlink.For some reason, all the hyperlinks take me to the details related to record #1.I know I'm doing some silly mistake here.I cant figure out what is it. Any help is appreciated.
Here's my code:
function editDetail()
{
document.forms[0].action="ErrorWorkflow?action=ErrorEditDetail";
document.forms[0].method="post";
//hidden fields
var xmlName = document.forms[0].nm_xml_file_stored.value;
var recId = document.forms[0].recId.value;
var e, f = document.forms;
var j, i, flen = f.length;
for (i=0; i<flen; i++) {
var recId = document.forms[0].recId.value;
}
document.forms[0].submit();
}
<!--- The hyperlink in xslt below -->
<a href="javascript:editDetail();" class="errorlink">
<xsl:attribute name="title">
<xsl:for-each select="attributeValidations/method/validationError">
<xsl:value-of select="."/>,
</xsl:for-each>
</xsl:attribute>
<xsl:value-of select="value"/>
</a>
Thanks,
I have a table with a bunch of rows and each row represents a record from the database table. Each row, is wrapped in a <form>.
On every row, I have a hyperlink that takes me to another page with details.I'm trying to pass the the variable recId, so that I can view the respective record details from the hyperlink.For some reason, all the hyperlinks take me to the details related to record #1.I know I'm doing some silly mistake here.I cant figure out what is it. Any help is appreciated.
Here's my code:
function editDetail()
{
document.forms[0].action="ErrorWorkflow?action=ErrorEditDetail";
document.forms[0].method="post";
//hidden fields
var xmlName = document.forms[0].nm_xml_file_stored.value;
var recId = document.forms[0].recId.value;
var e, f = document.forms;
var j, i, flen = f.length;
for (i=0; i<flen; i++) {
var recId = document.forms[0].recId.value;
}
document.forms[0].submit();
}
<!--- The hyperlink in xslt below -->
<a href="javascript:editDetail();" class="errorlink">
<xsl:attribute name="title">
<xsl:for-each select="attributeValidations/method/validationError">
<xsl:value-of select="."/>,
</xsl:for-each>
</xsl:attribute>
<xsl:value-of select="value"/>
</a>
Thanks,