p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

xslt thread: Re: is it possible to access Javascript variable in xsl


Message #1 by "Anbumani" <anbumani@i...> on Wed, 18 Sep 2002 06:43:20
hi,
did anyone get solution for this?
can anyone help to solve this problem?

regards
anbu

> Hi,
> I have a hidden variable in a form whose value gets incremented on click 
of
> a button. Is it possible to assign the same to a variable. 
> 
> The xsl snippet is as below. Is this really possible. I know that not 
being
> a procedural language we cannot declare a variable called 'i' and then 
say
> 'i=i+1'. But any inputs on this will be appreciated. Thanks in advance.
> 
> <head>
> <script>
> 	function inc()
> 	{
> 		document.test.hdnVar.value=document.test.hdnVar.value+1;
> 	}
> </script>
> 
> </head>
> <xsl:variable name="pCount" value="<!--here i need the value of
> hdnVar-->"></xsl:variable>
> <xsl:template match="/">
> 
> <form name = test>
> <input type="hidden" name="hdnVar" value="">
> <xsl:template match="mail">
> <xsl:for-each select=".">
> 	<table>
> 		<tr>
> 			<td>
> 				<xsl:value-of select ="from"/>
> 			</td>
> 
> 		</tr>
> 		<tr>
> 			<td>
> 				<xsl:value-of select ="subject"/>
> 			</td>
> 
> 		</tr>
> 	</table>
> 
> </xsl:for-each>
> <input type="button" value="NextPage" onClick="Javascript:inc()"/>
> </xsl:template>
> 
> </xsl:template>
> 
> Regards,
> Rajeev C V

  Return to Index