XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Lorrie NerbasSubject: Help with creating onclick event script in xsl
Author: Lorrie Nerbas
Date: 02 May 2006 03:37 PM
Hello, I am very new to xml and xsl.

I need help understanding how to write event script for my navigation menu. I created the xml and xls files in Style Studio and moved them to ASP.Net and used the <asp:xml control to display the menu, which works fine.

Now I need to write vbscript or javascript onclick_() event code for the buttons to direct the user to a division home page which matches the button name.

The aspx page and xsl pages are attached. Thank you very much in advance for your help with this.

Lorrie


UnknownNew14.xsl


UnknownxmlControl1

Postnext
Ivan PedruzziSubject: Help with creating onclick event script in xsl
Author: Ivan Pedruzzi
Date: 02 May 2006 04:07 PM
Lorrie,

This doesn't sound like a Stylus Studio question.

I suggest you to search on www.google.com you will find plenty of pages describing how to use javascript in HTML.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Posttop
Lorrie NerbasSubject: Help with creating onclick event script in xsl
Author: Lorrie Nerbas
Date: 03 May 2006 06:21 PM
You are misunderstanding my question. The code is below. When this is run, 12 buttons are generated from the for-each loop. Each button's value is the division name. I need to run an mybutton_onclick_() event, and get the division name. The user will then be redirected to their division's home page when the event is fired. Can this be accomlished using the value from <xsl:for-each select="cwhome/menu/division">?


<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft.com:xslt"
xmlns:user="http://mycompany/mynamespace">
<xsl:output method="html"/>
<xsl:template match="/">
<html><head></head>
<body>
<form name="form1" runat="Server">

<p>
<font style="font-size: 16pt; color: #3642a9; font-family: arial">
<xsl:value-of select="cwhome/title"/>
</font>
</p>
<p>
<table id="Table1" name="Table1" cellSpacing="0" cellPadding="0" width="88" style="table-layout: auto; ; width: 88px; font-family: arial; white-space: nowrap; position: absolute; text-align: center" onclick_="doclick()">
<tbody>
<xsl:for-each select="cwhome/menu/division">
<tr>
<td vAlign="middle" width="50%" id="">
<button id="mybutton" style="border-right: medium none; border-top: medium none; font-size: 10pt; filter: progid:dximagetransform.microsoft.gradient(gradienttype=0,startcolorstr=#bbbbe7,endcolorstr=#ddddff); vertical-align: top; border-left: medium none; width: 110px; color: midnightblue; border-bottom: medium none; font-family: arial; white-space: pre; height: 27px; text-align: center">
<xsl:value-of select="."/>

</button>

</td>
</tr>
</xsl:for-each>
<script language="vbscript" implements-prefix="user">
<![CDATA[
sub doclick()
msgbox(document.form1.elements(mybutton).value)
end sub
]]>
</script>

</tbody>
</table>
</p>
<p>
<xsl:call-template name="NewTemplate0"/>
</p>
</form>
</body>
</html>
</xsl:template>
<xsl:template name="NewTemplate0"/>
</xsl:stylesheet>

Thank-you.

Lorrie


 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.