[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

JavaScript problem again!

Subject: JavaScript problem again!
From: Johannes.Becker@xxxxxx
Date: Tue, 5 Nov 2002 10:11:18 +0100
html highlighter
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.