Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2008, 03:35 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default 2 Radio btn with one Submit btn, convert to 2 Btn


Hi, I don't know xslt - i just need a modification done to an existing xslt file.

At the moment the page has 2 radio buttons with a submit button, which exeutes the code dependant on the radio option selected.

Can anyone please help:
I want to convert this to two buttons:



<xsl:if test="$cTrigger &gt; '1'">
 <xsl:for-each select="Activity/ObjectGroup[@type='trigger']/Object">

   <xsl:element name="asp:RadioButton">
     <xsl:attribute name='id'><xsl:value-of select='@name' /></xsl:attribute>
     <xsl:attribute name='runat'>server</xsl:attribute>
     <xsl:attribute name='GroupName'>triggers</xsl:attribute>
     <xsl:if test="Value[. = 'on']">
         <xsl:attribute name='Checked'>True</xsl:attribute>
     </xsl:if>
   </xsl:element>

 </xsl:for-each>
</xsl:if>

<xsl:if test="$cTrigger &gt; '0'">
  <xsl:element name="asp:Button">
   <xsl:attribute name="id">___Submit</xsl:attribute>
   <xsl:attribute name="runat">server</xsl:attribute>
   <xsl:attribute name="text">Submit</xsl:attribute>
   <xsl:attribute name="CommandName">Submit</xsl:attribute>
  </xsl:element>
</xsl:if>

This is what I tried, by setting the value of ( test="Value[. = 'on']" ) onClick

<xsl:if test="$cTrigger &gt; '1'">
 <xsl:for-each select="Activity/ObjectGroup[@type='trigger']/Object">

   <xsl:element name="asp:Button">
     <xsl:attribute name='id'><xsl:value-of select='@name' /></xsl:attribute>
     <xsl:attribute name="onClick">
         <xsl:test="Value[. = 'on']"></xsl:test>
         <xsl:attribute name='Checked'>True</xsl:attribute>
     </xsl:attribute>
     <xsl:attribute name="runat">server</xsl:attribute>
     <xsl:attribute name="text">Submit</xsl:attribute>
     <xsl:attribute name="CommandName">Submit</xsl:attribute>
   </xsl:element>
 </xsl:for-each>
</xsl:if>

Please help converting this as i'm not sure what i'm doing but i'm trying to set the "test" value.


Regards

 
Old August 15th, 2008, 06:41 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You want <xsl:if test="">, not <xsl:test=""> (which isn't even valid XML, let alone valid XSLT).



/- Sam Judson : Wrox Technical Editor -/
 
Old August 15th, 2008, 07:00 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Yes i was trying things, i need to set the test value onclick
<xsl:if test="Value[. = 'on']"> - it is set when user clicks on radio button - so i'm trying to do it onclick

I appreciate the help.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate command btn Captions MattFinn7 Access VBA 2 September 17th, 2008 03:12 PM
ambigious default2 and btn event does not fire shoakat ASP.NET 2.0 Professional 1 June 19th, 2007 10:21 PM
In datagrid when checkbox true delete in btn click ashish2001mca ASP.NET Espanol 1 January 9th, 2006 08:45 AM
radio button onClick submit form crmpicco HTML Code Clinic 1 June 14th, 2005 08:32 AM
Executing main() from a control btn aaadetos Visual C++ 3 November 19th, 2004 06:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.