Subject: [xsl] JavaScript problem again! From: Johannes.Becker@xxxxxx Date: Tue, 5 Nov 2002 10:11:18 +0100 |
Hi, I want to "extract" from an xml-file via JavaScript. This function is activated when a dropdown changes (onchange). When it changes, certain entrys should be filled in another dropdown depending on whatever option was chosen. Here my code. It doesn't work. function wechsel() { choiceReport=document.reportFrm.report.selectedIndex; //Bestimmen welcher Eintrag markiert ist while (document.reportFrm.service.length > 1) //Alle Einträge(ausser der Kopfzeile[index0])löschen { document.reportFrm.service.options[document.reportFrm.service.length-1]=null; } if (choiceReport > 0) //Nur wenn die choiceReport im Steuerungsfeld größer als 0(0=kopfzeile),werden werte in 2.Feld eingetragen { switch (choiceReport) { case 0: // alert(choiceReport); var i = 0; // a loop counter for the options array <xsl:for-each select ="/portalLogin/frameMain/rowsReport/select_service/select_option_0"> document.reportFrm.service.options[i++] = new Option(<xsl:value-of select="@text"/>,<xsl:value-of select="@value"/>); </xsl:for-each> break; case 1: // alert(choiceReport); var i = 0; // a loop counter for the options array <xsl:for-each select ="/portalLogin/frameMain/rowsReport/select_service/select_option_1"> document.reportFrm.service.options[i++] = new Option(<xsl:value-of select="@text"/>,<xsl:value-of select="@value"/>); </xsl:for-each> break; case 2: // alert(choiceReport); var i = 0; // a loop counter for the options array <xsl:for-each select ="/portalLogin/frameMain/rowsReport/select_service/select_option_2"> document.reportFrm.service.options[i++] = new Option(<xsl:value-of select="@text"/>,<xsl:value-of select="@value"/>); </xsl:for-each> break; default: // alert(choiceReport); var i = 0; // a loop counter for the options array <xsl:for-each select ="/portalLogin/frameMain/rowsReport/select_service/select_option_3"> document.reportFrm.service.options[i++] = new Option(<xsl:value-of select="@text"/>,<xsl:value-of select="@value"/>); </xsl:for-each> break; } } document.reportFrm.service.selectedIndex=0 } /portalLogin is the root of the xml-file. All these paths are ok. I don't know what else to do. Could anyone give me a hint what I'm doing wrong? Thanks Jonny XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Word Highlighting, Paul Terray | Thread | RE: [xsl] JavaScript problem again!, Jarno . Elovirta |
RE: [xsl] generating entities in XS, Jarno . Elovirta | Date | Re: [xsl] Excel XML tranformation, Joeri Belis |
Month |