|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How to get the value selected by the User
> I am displaying a dynamically created xml file in an aspx page.
> The xml file contains the dates of the current week.When the User clicks
on one of the dates,I want to
> get that value in the aspx page.
> Currently, I am trying to set an attribute value, at the OnClick of the
date element through an
> msxsl:script function.But it doesn't seem to be going into that function.
I believe you are confusing XML extensions with JavaScript functions? Just
output the script as part of the <head> section, and call it without a name
space as you would in any normal HTML page...
Here's a modified version of your XSL:
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:DateSelect="urn:my-scripts">
<xsl:variable name="Seldate" />
<xsl:template match="/">
<html>
<head>
<![CDATA[
Public Function fEnterTimeDetails(byval dt_sel as Date)
seldate = dt_sel
msgbox("Hello")
return seldate
End Function
]]>
</head>
<body BgColor="FFAAAA">
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="DateList">
<table cellpadding="6" cellspacing="1">
<th ColSpan="2">
<font color="purple">Select a Date</font>
</th>
<xsl:for-each select="Day">
<tr>
<td width="100">
<font color="blue">
<xsl:value-of
select="@Name" />
</font>
</td>
<td Align="Right">
<font color="green">
<xsl:attribute
name="style">cursor=hand</xsl:attribute>
<xsl:attribute
name="OnClick">"fEnterTimeDetails('<xsl:value-of select="."
/><xsl:text></xsl:text>')"</xsl:attribute>
<xsl:value-of
select="." />
<xsl:text></xsl:text>
</font>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








