[CLOSED] CheckBoxGroup - RadioGroup validate()

  1. #1

    [CLOSED] CheckBoxGroup - RadioGroup validate()

    Hi all,

    what is asked here:

    http://extjs.com/forum/showthread.ph...ckbox+validate

    is what I'm searching for. Is there a way now to check if at least one Checkbox or Radio is checked in its group container?

    If not, can you suggest a way to solve this, by client side.

    Thanx a lot

    Matteo

    P.S. a validateGroup() function would really be great! :)
  2. #2

    RE: [CLOSED] CheckBoxGroup - RadioGroup validate()

    Hi Matteo,

    You can set AllowBlank="false" for Group.
    Please see the following example:
    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        
        protected void Page_Load(object sender, EventArgs e)
        {
        }
    
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:CheckboxGroup 
                ID="CheckboxGroup1" 
                runat="server" 
                AllowBlank="false"
                Vertical="true"
                ColumnsNumber="1"
                Width="200"
                MsgTarget="Title"
                FieldLabel="Auto Layout">
                <Items>
                    <ext:Checkbox ID="Checkbox4" runat="server" BoxLabel="Item 1" />
                    <ext:Checkbox ID="Checkbox5" runat="server" BoxLabel="Item 2" />
                    <ext:Checkbox ID="Checkbox6" runat="server" BoxLabel="Item 3" />
                    <ext:Checkbox ID="Checkbox7" runat="server" BoxLabel="Item 4" />
                    <ext:Checkbox ID="Checkbox8" runat="server" BoxLabel="Item 5" />
                </Items>
            </ext:CheckboxGroup> 
            
            <ext:Button runat="server" Text="Validate">
                <Listeners>
                    <Click Handler="#{CheckboxGroup1}.validate();" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
  3. #3

    RE: [CLOSED] CheckBoxGroup - RadioGroup validate()

    Hi Vlad,

    ok, sorry for some reason I forgot the AllowBlank property, I built it at runtime.
    Now works fine, confirm it is solved.

    Thank you

    Matteo

Similar Threads

  1. CheckboxGroup and RadioGroup display issue
    By zhaoxl in forum 1.x Help
    Replies: 9
    Last Post: Jan 04, 2012, 4:05 AM
  2. Replies: 9
    Last Post: Jun 15, 2011, 7:01 AM
  3. [CLOSED] CheckboxGroup, RadioGroup & IE6
    By Justin_Wignall in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 26, 2011, 1:08 PM
  4. Replies: 0
    Last Post: Oct 28, 2009, 6:05 AM
  5. Validate
    By davidhoyt in forum 1.x Help
    Replies: 2
    Last Post: Dec 13, 2008, 2:13 AM

Posting Permissions