This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

FW: Toggling radio buttons




-----Original Message-----
From: Elisabeth Kaminski [mailto:ekaminski@austin400.com]
Sent: Thursday, August 23, 2001 3:07 PM
To: XSL-List@lists.mulberrytech.com
Subject: Toggling radio buttons


I am trying to set the default value of radio button on one of my pages.  I
haven't had any trouble setting the intial values, but when I change the
value by clicking on another button, my database is updated with the correct
value but it is still displaying the default value!!!  I've tried a couple
variations of code so far.  If I don't set a default value I don't have
problems.  But I was my users to see the No radio button checked even if
it's the first time on the page.

Here is my code.  The radio buttons are simple Yes No radio buttons with
values of Y and N, respectively.

 <input type="radio" name="rdoGIQ6" value="Y"
onClick="disableGroup(this.form, 'txtGIQ6T', false)">
 	<xsl:if match=".[hlfr9_questions/giq6='Y']">
      	<xsl:attribute name="checked">1</xsl:attribute>
      </xsl:if>
</input>Yes

<input type="radio" name="rdoGIQ6" value="N"
onClick="disableGroup(this.form, 'txtGIQ6T', true)">
      <xsl:if not=".[hlfr9_questions/giq6='Y']">
     		<xsl:attribute name="checked">1</xsl:attribute>
      </xsl:if>
</input> No

The above code sets the No radio button to checked when a user first access
the page.  When I select the Yes radio button, my  database gets updated
with the correct value Y but I'm still seeing the No radio button being
check.

I have also tried the following code with the same result:

<input type="radio" name="rdoGIQ1" value="Y"
onClick="disableGroup(this.form, 'txtGIQ1T', false)">
	<xsl:choose>
		<xsl:when test=".[hlfr9_questions/giq1='Y']">
			<xsl:attribute name="checked">1</xsl:attribute>
		</xsl:when>
	<xsl:otherwise>
	</xsl:otherwise>
	</xsl:choose>
</input>Yes

<input type="radio" name="rdoGIQ1" value="N"
onClick="disableGroup(this.form, 'txtGIQ1T', true)">
	<xsl:choose>
		<xsl:when not=".[hlfr9_questions/giq1='Y']">
			<xsl:attribute name="checked">1</xsl:attribute>
		</xsl:when>
	<xsl:otherwise>
	</xsl:otherwise>
	</xsl:choose>
</input> No

Am I even on the right track?  Any suggestions would be greatly appreciated!
Elisabeth


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]