4 Replies - 673 Views - Last Post: 23 July 2012 - 12:14 PM Rate Topic: -----

#1 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 386
  • View blog
  • Posts: 2,657
  • Joined: 12-January 10

xsl question

Posted 23 July 2012 - 08:51 AM

how can i get the color to change on the output of a check box if "yes" is selected?

  <td class="lbltxt"><INPUT type="radio" ID="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" VALUE="Y" NAME="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" class="trans">
		[b]            <xsl:if test="PS_FORM/SUBJECT_PROPERTY/Sold_6Months = 'Y'">
		     <xsl:attribute name="checked">
				     	<xsl:value-of select="true" />
			           </xsl:attribute>
		            </xsl:if></INPUT>Yes[/b][code]

&nbsp;<INPUT type="radio" ID="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" VALUE="N" NAME="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" class="trans">
<xsl:if test="PS_FORM/SUBJECT_PROPERTY/Sold_6Months = 'N'">
<xsl:attribute name="checked">
<xsl:value-of select="true" />
</xsl:attribute>
</xsl:if></INPUT>No
[/code]


the boled section needs to be red when yes is selected.


I tried

  <td class="lbltxt"><INPUT type="radio" ID="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" VALUE="Y" NAME="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" class="trans">
		            <xsl:if test="PS_FORM/SUBJECT_PROPERTY/Sold_6Months = 'Y'">
		     <xsl:attribute name="checked">
				  [b]   	<font class" myredclass" <xsl:value-of select="true" />
			           </xsl:attribute><font>[/b]
		            </xsl:if></INPUT>Yes
		&nbsp;<INPUT type="radio" ID="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" VALUE="N" NAME="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" class="trans">
		            <xsl:if test="PS_FORM/SUBJECT_PROPERTY/Sold_6Months = 'N'">
			           <xsl:attribute name="checked">
				          <xsl:value-of select="true" />
			           </xsl:attribute>
		            </xsl:if></INPUT>No



and variations of that where myfontclass is the class i have that has colors in it.

Is This A Good Question/Topic? 0
  • +

Replies To: xsl question

#2 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5643
  • View blog
  • Posts: 12,359
  • Joined: 16-October 07

Re: xsl question

Posted 23 July 2012 - 09:15 AM

Use the same logic. You're really just looking to make the Yes red. Wrap in a span and use a conditional attribute.

<td class="lbltxt">
	<INPUT type="radio" ID="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" VALUE="Y" NAME="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" class="trans">
		<xsl:if test="PS_FORM/SUBJECT_PROPERTY/Sold_6Months = 'Y'">
		     <xsl:attribute name="checked"><xsl:value-of select="true" /></xsl:attribute>
		</xsl:if>
	</INPUT>
	<span><xsl:if test="PS_FORM/SUBJECT_PROPERTY/Sold_6Months = 'Y'">
		     <xsl:attribute name="style"><xsl:value-of select="color:#f00" /></xsl:attribute>
		</xsl:if>
		Yes
	</span>
	<INPUT type="radio" ID="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" VALUE="N" NAME="PS_FORM/SUBJECT_PROPERTY/Sold_6Months" class="trans">
		<xsl:if test="PS_FORM/SUBJECT_PROPERTY/Sold_6Months = 'N'">
			<xsl:attribute name="checked"><xsl:value-of select="true" /></xsl:attribute>
		</xsl:if>
	</INPUT>
	No


Was This Post Helpful? 0
  • +
  • -

#3 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 386
  • View blog
  • Posts: 2,657
  • Joined: 12-January 10

Re: xsl question

Posted 23 July 2012 - 10:05 AM

i get this error when i try your code:


Expected end of the expression, found ':'.
color -->:<-- #FF0000

Was This Post Helpful? 0
  • +
  • -

#4 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5643
  • View blog
  • Posts: 12,359
  • Joined: 16-October 07

Re: xsl question

Posted 23 July 2012 - 11:50 AM

Then, um, fix it? :P

Try:
<xsl:attribute name="style">color:#f00</xsl:attribute>


Was This Post Helpful? 1
  • +
  • -

#5 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 386
  • View blog
  • Posts: 2,657
  • Joined: 12-January 10

Re: xsl question

Posted 23 July 2012 - 12:14 PM

View Postbaavgai, on 23 July 2012 - 02:50 PM, said:

Then, um, fix it? :P

Try:
<xsl:attribute name="style">color:#f00</xsl:attribute>





You are the man!!!!!!!!!!!!!!!!!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1