473,397 Members | 2,033 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,397 software developers and data experts.

2 Radio btn with one Submit btn, convert to Two Buttons

200 100+
Hi, I don't know xslt - i just need a modification done to 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:

<!-- This is the original code -->
<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
Aug 15 '08 #1
1 2208
Dormilich
8,658 Expert Mod 8TB
This is what I tried, by setting the value of ( test="Value[. = 'on']" ) onClick
note on test: what you put in quotation marks has to be an expression. "Value[. = 'on']" means: if there (current node) exists an element named "Value" that has an (can not identify type) named "." whose value is "on", do something.
To me this does not make sense (so to the parser).

the correct expression depends on what element you want to test. example:
Expand|Select|Wrap|Line Numbers
  1. // xml snippet
  2. <button value="on" />
  3. // xsl expression
  4. <xsl:if test="button[@value = 'on']"></xsl:if>
  5.  
  6. // another xml
  7. <button>
  8.   <value>on</value>
  9. </button>
  10. // xsl expression
  11. <xsl:if test="button[value = 'on']"></xsl:if>
if you can provide us with the appropriate xml snippet, we can have a look at the matter again, otherwise we're lost in the woods.

PS: wildcard character is *; . refers to current node, but you can use it only on start of expression or inside xpath functions (e.g. ".", "./parent::*", "name(.)")
Aug 28 '08 #2

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

Similar topics

3
by: Owen Funkhouser | last post by:
I have a form with three radio options. And I have three buttons: <input type="submit" name="mainform_action" value="Edit Data"> <input type="submit" name="mainform_action" value="View Data">...
15
by: JR | last post by:
Hi. I hope someone out there who is more versed with JavaScript than I can help me with the following annoying problem. Here's the problem. I have a form with the following layout: Column A...
1
by: sman | last post by:
Hi, I recently read this article on About.com on how to create required fields for a form: http://javascript.about.com/library/scripts/blformvalidate.htm Everything works great except that there...
4
by: Jay | last post by:
I have a form used to submit data (no surprises there!). I'd like to be able to populate the same form with previously submitted data. The data lives in a database once submitted and using ASP I...
3
by: Ken Varn | last post by:
This is probably a simple question, but I am new to this so bear with me. I have a ASP.NET form that has a checkbox and a 2 radio buttons. When the checkbox is checked, the 2 radio buttons are...
1
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
10
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
7
by: moksha | last post by:
Hi, I am new to javascript and i am facing a problem in coding. plz help me out. I am using javascript for dynamically creating a table row which contains text boxes and radio...
5
by: satyabhaskar | last post by:
hi all, In my web page i have created radio buttons dynamically on to the page .....following is my code string Course, Semester, Section; int rowsCount; string con =...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.