473,382 Members | 1,611 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,382 software developers and data experts.

How can I call this javascript function in xsl?

2
Hello,
Please forgive me that I posted same question on several forums, but I haven't got answer yet.

My problem is that I need to add calendar javascript widget in xsl file.


First I have Calendar javascript I used before, and
Here is the html file that used calendar javascript I used before.



Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title> New Post </title>
  6. <meta http-equiv="Content-Type"
  7. content="text/html; charset=iso-8859-1 "/>
  8. <script type="text/javascript" src="calendarDateInput.js">
  9. /***********************************************
  10. * Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm
  11. * Script featured on and available at http://www.dynamicdrive.com
  12. * Keep this notice intact for use.
  13. ***********************************************/
  14. </script>
  15. </head>
  16. <body>
  17. ....
  18. <label>On Date : </label>
  19. <script>DateInput('onDate', true, 'YYYY-MM-DD', '<?=shownDate($onDate);?>')</script>
  20. ...
  21. </body>
  22. </html>


And here is the xsl file I tried to add java script


Expand|Select|Wrap|Line Numbers
  1. <xsl:template match="node()" mode="head">
  2. <head>
  3. <script type="text/javascript">
  4. <xsl:attribute name="src">calendarDateInput.js</xsl:attribute>
  5. <xsl:comment>Comment added so script is recognised</xsl:comment>
  6. </script>
  7.  
  8. </head>
  9. </xsl:template>
  10.  
  11. <xsl:template name="report-params-dates">
  12. <!-- Start Date We use calendar widget -->
  13. <label for="start" id="start_label"> 
  14. <xsl:text>Start Date: </xsl:text>
  15. <script>DateInput('onDate', true, 'YYYY-MM-DD')</script> 
  16. </label>
  17. </xsl:template>
The result? There is no calendar shown and said there is error in that page. I know I didn't do correctly, but I don't know how to fix it.

I really appreciate your help.

Thanks,
Sep 23 '08 #1
2 4131
jkmyoung
2,057 Expert 2GB
You've added the <script> tag inside the <label>
Pretty sure you didn't want to do that.

Also:Why even use an <xsl:attribute>? Why not just:
<script type="text/javascript" src="calendarDateInput.js">
Sep 23 '08 #2
lmsook
2
I tried as you suggested in both ways,
but it still doesn't work....
Sep 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: chirs | last post by:
I am trying to understand a piece of code. In a javascrpit file, there is a function: function ItemStyle(){ var names=; addProps(this,arguments,names,true); }; In the html file, it calls...
5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
1
by: cheezebeetle | last post by:
ok, so I am having problems passing in an ASPX function into the Javascript in the codebehind page. I am simply using a confirm call which when they press "OK" they call this ASPX function, when...
3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
18
by: Chris Ianson | last post by:
Hi geniuses (or is that genii, or genies) The challenge is as above really. I have a page with an iframe in it, and need to call a JS function in the *parent* page, *from* inside the iframe. ...
3
by: KaNos | last post by:
Hi, "robot script pages" are html+javascript pages, can be played in aspx player. So in this tech, robot call aspx player's function (an interface is sheared) and wait a result synchronously with...
3
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of...
10
by: evicailieva | last post by:
A have a php scrip where I call a JavaScript function. I don't know why, but it doesn't work. At the beginning, when I was writing the script it was working but now it's not. I don't know wхat to do....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.