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>
|