This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Combo box and event Onchange
- To: <xsl-list at mulberrytech dot com>
- Subject: RE: Combo box and event Onchange
- From: "Igor Nakshin" <inakshin at sprynet dot com>
- Date: Thu, 6 Apr 2000 09:36:37 -0500
- Reply-To: xsl-list at mulberrytech dot com
Catherine,
> When I dispay the value pass to my javascript function (with alert in
> javascrip), there is no value.
That's a different problem.
try something like
<xsl:element name="select">
<xsl:attribute name="id">mycombo</xsl:attribute>
<xsl:attribute name="OnChange">ChargeRecherche()/xsl:attribute>
<xsl:attribute name="name">listeRecherche</xsl:attribute>
<xsl:for-each select="liste">
<xsl:element name="option">
<xsl:attribute name="value">
<xsl:value-of select="@Id"/>
</xsl:attribute>
<xsl:value-of select="@Name"/>
</xsl:element>
</xsl:for-each>
</xsl:element>
<script language="javascript">
<![CDATA[
function ChargeRecerche() {
alert(mycombo[mycombo.selectedIndex].value);
}
]]>
</script>
Depending on the browser you are using you might need to change reference to
my combo object in
javascript to document.all[] or something like that.
Igor.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list