This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Combo box and event Onchange


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]