Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't know of any way to validate a check box directly but here is an example of a manually created validator for multiple check boxes found inside of a FormItem:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" minWidth="955" minHeight="600" layout="vertical" &gt; &lt;mx:Script&gt; &lt;![CDATA[ private function doValidation():void{ var itemsSelected:int = 0; for each(var checkBox:CheckBox in app.getChildren()){ if(checkBox.selected){ itemsSelected++; } } if(itemsSelected == 0){ app.filters = [errorGlow]; app.toolTip = "You must select at least one value"; }else{ app.filters = []; app.toolTip = ""; } } private function checkBoxClicked(e:Event):void{ if((e.currentTarget as CheckBox).selected == true){ app.filters = []; app.toolTip = ""; } } ]]&gt; &lt;/mx:Script&gt; &lt;mx:GlowFilter id="errorGlow" color="0xFF0000" blurX="5" blurY="5" /&gt; &lt;mx:Form&gt; &lt;mx:FormItem id="app" width="520" label="Application" &gt; &lt;mx:CheckBox id="checkBox1" label="Item 1" selected="false" click="checkBoxClicked(event)"/&gt; &lt;mx:CheckBox id="checkBox2" label="Item 2" selected="false" click="checkBoxClicked(event)"/&gt; &lt;mx:CheckBox id="checkBox3" label="Item 3" selected="false" click="checkBoxClicked(event)"/&gt; &lt;mx:CheckBox id="checkBox4" label="Item 4" selected="false" click="checkBoxClicked(event)"/&gt; &lt;mx:CheckBox id="checkBox5" label="Item 5" selected="false" click="checkBoxClicked(event)"/&gt; &lt;mx:CheckBox id="checkBox6" label="Item 6" selected="false" click="checkBoxClicked(event)"/&gt; &lt;mx:CheckBox id="checkBox7" label="Item 7" selected="false" click="checkBoxClicked(event)"/&gt; &lt;/mx:FormItem&gt; &lt;/mx:Form&gt; &lt;mx:Button width="60" label="Send" id="submit" click="doValidation()" /&gt; &lt;/mx:Application&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload