Radio button selected Color!

Avatar

Avatar

fshuja

Avatar

fshuja

fshuja

19-11-2009

The default color for a selected radio button is black. I want to change it to red or some other color?

How can i change it?


Is there any code snippet for XFA?

thanks

Faraz

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Jono_Moore

Avatar

Jono_Moore

Jono_Moore

19-11-2009

You have to edit the xml. Once you've got it made you can save it as a library object.

You need to add a <fill><color value/></fill> section inside the <font></font> tag. If there is nothing else there the font tag may just look like <font typeface="Myriad Pro"/> you'll need to split the "/" out into its own closing tag <font typeface="Myriad Pro"></font>:

<field name="BlueCheckmark" w="4.319mm" h="4.278mm">
    <ui>
       <checkButton size="4.2333mm" mark="check">
          <border hand="right" presence="hidden">
             <?templateDesigner StyleID apcb0?></border>
       </checkButton>
    </ui>
    <font size="0pt" typeface="Adobe Pi Std">
       <fill>
          <color value="0,0,255"/>
       </fill>
    </font>

    <para vAlign="middle"/>
    <value>
       <integer>0</integer>
    </value>
    <items>
       <integer>1</integer>
       <integer>0</integer>
       <integer>2</integer>
    </items>
</field>

Answers (9)

Answers (9)

Avatar

Avatar

Geckoz100

Avatar

Geckoz100

Geckoz100

23-11-2015

Never mind -- I discovered that the white box frame disappears as soon as focus is moved to another object on the page.  So just the inside of the button stays white (with the black center).

Avatar

Avatar

Geckoz100

Avatar

Geckoz100

Geckoz100

20-11-2015

Great stuff, I had no idea this could be done.  I have one question:  I have three radio buttons where "High" turns red when selected, "Medium" turns yellow, and "Low" turns green.  In the screenshot below you can see there's a white box around each radio button that stays white.  I don't mind if the the radio button itself is white/black, but I would like to have square area around each button to match the color of the entire button label.  Can this be done via XML like the examples above?  Thanks for any help.

Hi-Med-Low.jpg

Medium.jpg

The buttons are scripted like this:


// High button


if (this.rawValue == "1")


  {


  this.fillColor = "204,0,0"; //red fill


  this.caption.font.fill.color.value = "255,255,255"; //white font


  Medium.fillColor = "255,255,255"; // Medium button white fill


  Low.fillColor = "255,255,255"; // Low button white fill


  Low.border.edge.color.value = "255,255,255"; // Low button white border (removes black border)


  Low.caption.font.fill.color.value = "0,0,0"; // Low button black font


  }



// Medium button


if (this.rawValue == "2")


  {


  this.fillColor = "240,240,0"; // yellow fill


  High.fillColor = "255,255,255"; // High button white fill


  High.caption.font.fill.color.value = "0,0,0"; // High button black font


  Low.caption.font.fill.color.value = "0,0,0"; // Low button black font


  Low.fillColor = "255,255,255"; // Low button whilte fill


  Low.border.edge.color.value = "255,255,255"; // white border (removes black border)


  }



// Low button


if (this.rawValue == "3")


  {


  this.fillColor = "0,160,0"; // green fill


  this.caption.font.fill.color.value = "255,255,255"; // white font


  High.fillColor = "255,255,255"; // High button white fill


  High.caption.font.fill.color.value = "0,0,0"; // High button black font


  Medium.fillColor = "255,255,255"; // Medium button white fill


  Medium.caption.font.fill.color.value = "0,0,0"; // Medium button black font


  }


Avatar

Avatar

Marty_McFly73

Avatar

Marty_McFly73

Marty_McFly73

26-09-2013

Editing the XML worked great for me too.  It was the only way I was able to change the colour of the actual 'filled in button' part of the radio button.  Thanks so much for this!

Avatar

Avatar

Jono_Moore

Avatar

Jono_Moore

Jono_Moore

20-11-2009

There's lots of info available here: http://www.adobe.com/devnet/livecycle/designing_forms.html

I don't think you generally want to do much editing in the XML source, better to use the tools in LiveCycle.

Avatar

Avatar

fshuja

Avatar

fshuja

fshuja

20-11-2009

To "Jono Moore"

Yes thats exactly what i was looking for. I want to learn this xml of adobe forms. How and from where i can learn this? Any book/document?

thanks

Faraz

Avatar

Avatar

xrum

Avatar

xrum

xrum

19-11-2009

im curious how you did this, i don't see the code anywhere, is it in the settings?

Avatar

Avatar

fshuja

Avatar

fshuja

fshuja

19-11-2009

Thanks for the help.

Still in the attached document the selected color is black. How can i change that color?

Avatar

Avatar

_Nith_

Avatar

_Nith_

_Nith_

19-11-2009

This is unprotected copy.

Nith

Avatar

Avatar

_Nith_

Avatar

_Nith_

_Nith_

19-11-2009

See that attached sample.

-Nith