Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: can't get checkbox values using msxsl:script

From: "Joe Fawcett" <joefawcett@---------.------>
To: NULL
Date: 9/10/2008 8:22:00 AM

You've already had a reply to this question, By Martin Honnen.
Once the XSLT has finished the only script that can execute is one in the 
HTML. Your script executes inside the XSLT which has no reference to the 
HTML DOM. So if you show what HTM
-- 

Joe Fawcett (MVP - XML)

http://joe.fawcett.name
L you want then we can probably help with the script, although that question 
is nothing to do with XSLT, it's an HTML/JavaScript problem.

"bgraves" <bgraves@w...> wrote in message 
news:8baa92e7-cadd-4162-b0a6-6aa108928ade@s......
> 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> 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent