Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: can't get checkbox values using msxsl:script can't get checkbox values using msxsl:scriptTo: NULL Date: 9/9/2008 11:33:00 AM How can I get values from named controls? I don't seem to have access
to anything on the page. When I use this stylesheet, I always get the
following error:
System.ArgumentException: Last Trace Point=[]. Object required
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="urn:schemas-microsoft-com:xslt">
<msxsl:script language="JavaScript" implements-prefix="user">
<![CDATA[
function GetCheckboxes(f)
{
var prodIds = ""
for(var i = 0;i<f.chk.length;i++)
{
if(f.chk[i].checked)
{
prodIds = prodIds + "," + f.chk[i].value;
}
}
return prodIds
}
]]>
</msxsl:script>
<xsl:template match="/">
<div id="centerFull">
<br/>
<br/>
<center>
<input type="checkbox" name="chk" id="c1" value="val1" />
<input type="checkbox" name="chk" id="c2" value="val2" />
<input type="button" value="Compare"
onclick='window.open("compare.aspx?
productIDs={user:GetCheckboxes(this)}")'></input>
</center>
</div>
</xsl:template>
</xsl:stylesheet>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
