xsl-list
[Top] [All Lists]

Re: Pass a variable value from javascript to xsl

2005-04-07 05:45:55
"ohtar" == ohtar  <enrech(_at_)gmail(_dot_)com> writes:

    ohtar> I am trying to pass a variable value from javascript to
    ohtar> xsl. For example, I have a xsl:variable called instance:
 
 
    ohtar>  <xsl:variable name="instance"/>
 
 
    ohtar>   And I want to assign a javascript variable value to
    ohtar> 'instance' The javascript code is:
  
 
    ohtar>  <script language="JavaScript"> function example(){ var art
    ohtar> art =
    ohtar> 
document.exampleForm.artistOnChange[document.noadsterForm.artistOnChange.selectedIndex].text
    ohtar> } </script>
 
    ohtar> I call the javascript function in my xsl code when someone
    ohtar> select something in a form:

You are NOT calling the javascript function from your xslt code - you
are using XSLT to GENERATE a call to a javascript function (presumably
you are generating html). This is a very different thing indeed.
  
    ohtar>  <select name="artistOnChange" onchange="example">
 
 
    ohtar>   I want to save the value of the javascript variable 'art'
    ohtar> into the xsl:variable 'instance'. How can I do that?  I'm
    ohtar> using xalan.
  
You can't. XSLT finishes, and you are left with an html page, which
you are then displaying (presumably) in your web browser.
-- 
Colin Paul Adams
Preston Lancashire

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>