473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Accessing javascript variable in xsl

Hi to all,
I have this problem in xsl wherein i want to access a variable in
javascript and use it my xsl. How would i access or use a javscript
variable in my xsl file?

Please help.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #1
5 12594
In article <42**********@127.0.0.1>, we****@yahoo.com enlightened us with...
Hi to all,
I have this problem in xsl wherein i want to access a variable in
javascript and use it my xsl. How would i access or use a javscript
variable in my xsl file?


Import the file where it is defined, same as html.
You can also make a function and pass a variable, I would think.

--
--
~kaeli~
Synonym: the word you use in place of a word you can't
spell.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
hi thanks for the reply, but i can't figure out the syntax for accessing
the variable. I also tried the function but i have problems with it.

this is my sample code:
<input name="txtPhone" type="hidden" >
<xsl:attribute name="value"> <xsl:value-of
select="ffe:XML/ffe:Contact/ffe:Telephone"/>
</xsl:attribute>
</input>
<script language="javascript">
var fone= formatPhone(document.all.txtPhone.value);
</script>

<xsl:variable name="cPhone"> <xsl:value-of select="$fone"/>
</xsl:variable>

In this sample code, i have xsl variable cPhone and the value of it
should be the value of a javascript variable fone, but it doesnt work.
waaahhhhhhh please help.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
hi thanks for the reply, but i can't figure out the syntax for accessing
the variable. I also tried the function but i have problems with it.

this is my sample code:
<input name="txtPhone" type="hidden" >
<xsl:attribute name="value"> <xsl:value-of
select="ffe:XML/ffe:Contact/ffe:Telephone"/>
</xsl:attribute>
</input>
<script language="javascript">
var fone= formatPhone(document.all.txtPhone.value);
</script>

<xsl:variable name="cPhone"> <xsl:value-of select="$fone"/>
</xsl:variable>

In this sample code, i have xsl variable cPhone and the value of it
should be the value of a javascript variable fone, but it doesnt work.
waaahhhhhhh please help.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #4
In article <42**********@127.0.0.1>, we****@yahoo.com enlightened us with...
hi thanks for the reply, but i can't figure out the syntax for accessing
the variable. I also tried the function but i have problems with it.

this is my sample code:
<input name="txtPhone" type="hidden" >
<xsl:attribute name="value"> <xsl:value-of
select="ffe:XML/ffe:Contact/ffe:Telephone"/>
</xsl:attribute>
</input>
<script language="javascript">
<script type="text/javascript">
var fone= formatPhone(document.all.txtPhone.value);
Where is the function formatPhone? I see no other script tags importing it.
Also, document.all is MSIE specific. Use document.formname.fieldname.value.
</script>

<xsl:variable name="cPhone"> <xsl:value-of select="$fone"/>


I'm not all that great with XML/XSL yet. What's with the dollar sign?

I think you wanted:
<script type="text/javascript">
document.write("<xsl:value-of select=\""+fone+"\" />");
</script>
--
--
~kaeli~
If a turtle doesn't have a shell, is he homeless or naked?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5

"ms_chika" <we****@yahoo.com> wrote in message news:42********@127.0.0.1...

In this sample code, i have xsl variable cPhone and the value of it
should be the value of a javascript variable fone, but it doesnt work.
waaahhhhhhh please help.


Hi,

XSL developers are more likely to be knowledgeable about this kind of
problem. I recommend:

http://lists.mulberrytech.com/xsl-list/archives/

Good luck,

Michèle Ouellet
Stelvio Inc.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter | last post by:
Hello, Two newbie questions: 1) I have a javascript file with a function in it. From this function I want to access a variable in another javascript file -which is not inside a function. I...
6
by: Chris Styles | last post by:
Dear All, I've been using some code to verify form data quite happily, but i've recently changed the way my form is structured, and I can't get it to work now. Originally : The form is...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
19
by: k.karthikit | last post by:
Hello all, In some hidden variable (<input type="hidden" name="hiddenId" value="test" /> ,i stored some value.I accessed the value "test" using var id = document.getElementById( 'hiddenId' );...
6
by: leppert | last post by:
Hello, I am trying to access a javascript variable on another site. The site requires the user to be logged in, so what I am doing is submitting a form and redirecting the output to an IFRAME,...
2
by: ksr | last post by:
Hello, I have a HTML page, which loads an activeX control in the browser. In the <HEADsection, I have javascript similar to the following, <SCRIPT language="JavaScript"> var Index = ""; //...
3
by: BAnderton | last post by:
Hello all, Question: Is there any way to access a javascript variable from within psp code? I'm aware of how to do the reverse of this (js_var='<%=psp_var%>'). Here's a non-working...
2
by: Zuhaib Hyder | last post by:
please remove double quote error in accessing javascript variable in c# , Page.RegisterStartupScript("MyScript", "<script language=javascript> var thumb = null;thumb =...
2
Frinavale
by: Frinavale | last post by:
Hi! I am dynamically generating external .js JavaScript resources to be used with a Tab control I created (using VB.NET). Originally, the JavaScript was written directly into the <head> of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.