Results 1 to 2 of 2

Thread: Validate if any radio box is selected

  1. #1
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    589

    Question Validate if any radio box is selected

    Hi!

    How can I have a validator which checks if a radi boy is selected?

    Here's a quick example what i want to have:
    Code:
    var form = new Ext.form.FormPanel({
        monitorValid: true,
        title: 'How to validate that a radiobox is selected?',
        renderTo: document.body,
        items: [{
            xtype    : 'radiogroup',
            defaults : {
                xtype     : 'radio',
                name      : name,
                hideLabel : true
            },
            items: [{
                boxLabel  : "Yes",
                inputValue: 1
            }, {
                boxLabel  : "No",
                inputValue: 0
            }]
        }],
        buttons: [{
            text: 'Should only be clickable if a radio box is selected',
            handler: Ext.emptyFn,
            formBind:true
        }]
    });
    
    form.startMonitoring();
    thx
    Dumas

  2. #2
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    589

    Default

    solved:
    Add allowBlank: false to the radio group

Similar Threads

  1. How do i get the selected radio buttons in a grid ?
    By Nimeshs in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 27 Apr 2010, 8:11 PM
  2. Getting the value of a selected radio button
    By dana.lees in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 16 Aug 2009, 4:00 AM
  3. Get selected radio in a radiogroup
    By wgpubs in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 1 Jun 2009, 2:01 PM
  4. How to get the selected value from radio group
    By samith143 in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 4 May 2009, 11:58 AM
  5. How to pre-set the selected box in radio
    By kennethhui in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 4 Dec 2007, 10:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •