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 10th, 2011, 08:34 AM
Registered User
 
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Radio button problem

Hi all,
I am new to this forum and am stuck on one radio button problem. I have 3 radio buttons as mesage capture,message simulation and Off. When the page loads for the first time,Off radio button is checked(which is default).Now if I click on message capture, the page sends an xml to the server and server returns an xml back and database gets updated but message capture is NOT checked. As I can see, the page re-loads but only the default radio button i.e. off remains checked.
Then I logoff and login again. Now as the database got updated , when I load the page for the first time again , then message capture is checked this time by default. I want it to be checked, when I myself checked it, as well. Same is the case for message simulation button.
The XML sent by server when page loads(first time) is: Transaction/Global/Switch
The XML sent by server when page loads(when i click on message capture) is: Transaction/MeCap/Switch
The XML sent by server when page loads(when i click on message simulation) is: Transaction/MeSim/Switch
The XML sent by server when page loads(when i click on Off) is: Transaction/OffSim/Switch
Please help me as soon as possible
************************************************** *************
The code is as below:
<code>
<table>
<tr>
<xsl:variable name="switchON" select="Transaction/Global/Switch"/>
<xsl:variable name="MeCap" select="Transaction/MeCap/Switch"/>
<xsl:variable name="MeSim" select="Transaction/MeSim/Switch"/>
<xsl:variable name="OffSim" select="Transaction/OffSim/Switch"/>
<td><b color="#0000FF">1)</b>
<input name="switch" type="radio" value="" onClick="buildxml(CAP);">
<xsl:choose>
<xsl:when test="substring($switchON,1,1)='C'">
<xsl:attribute name="checked"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="value">
<xsl:value-of select="$MeCap"/>
</xsl:attribute>
<xsl:if test="substring($MeCap,1,2)='ON'">
<xsl:attribute name="checked"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<script language="JavaScript">
var CAP="CAP";
</script>
</input> <b color="#0000FF">Message Capture</b>
</td>
</tr>
<tr>
<td><b color="#0000FF">2)</b>
<input name="switch" type="radio" value="" onClick="buildxml(SIM);">
<xsl:choose>
<xsl:when test="substring($switchON,1,1)='S'">
<xsl:attribute name="checked"/>
</xsl:when>
<xsl:otherwise>

<xsl:attribute name="value">
<xsl:value-of select="$MeSim"/>
</xsl:attribute>
<xsl:if test="substring($MeSim,1,2)='ON'">
<xsl:attribute name="checked"/>
</xsl:if>

</xsl:otherwise>
</xsl:choose>
<script language="JavaScript">
var SIM="SIM";
</script>
</input> <b color="#0000FF">Message Simulation</b>
</td>
</tr>
<tr>
<td><b color="#0000FF">3)</b>
<input name="switch" type="radio" value="" onClick="buildxml(OFF);">
<xsl:choose>
<xsl:when test="substring($switchON,1,1)=''">
<xsl:attribute name="checked"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="substring($OffSim,1,2)='OFF'">
<xsl:attribute name="value">
<xsl:value-of select="'Off'"/>
</xsl:attribute>
<xsl:attribute name="checked"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<script language="JavaScript">
var OFF="OFF";
</script>
</input> <b color="#0000FF">Off</b>
</td>
</tr>
</table>
</code>





Similar Threads
Thread Thread Starter Forum Replies Last Post
VBExpress 2005 : Radio Button Problem mague Visual Basic 2005 Basics 0 July 4th, 2007 02:13 AM
Radio button problem rkid VBScript 1 May 21st, 2007 02:08 PM
Radio button problem rkid BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 April 24th, 2007 12:42 AM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM





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