Results 1 to 3 of 3

Thread: Radio Group / Checkbox Group Model Validation Error Messages

  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2009
    Location
    Hamilton ON Canada
    Posts
    25

    Default Radio Group / Checkbox Group Model Validation Error Messages

    Hey,

    Just solved a problem that I thought I would share.

    My Scenario:
    Model field that must be Yes (used Inclusion validation with a list that includes the value 1)
    Used a radio group with 2 radio buttons, Yes and No. Input Values 1 and 2 respectively.

    Problem:
    Error message was not showing because the "name" property is on the radio buttons which do not present validation messages.

    Solutions:
    Set the config value "CombineErrors", which defaults to false, to true.
    This will allow the form to show the error messages from the model validation on the RadioGroup or Checkbox Group.

    Hope that helps someone out!

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,450

    Default

    Thanks for sharing with the community!
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    321

    Default

    Old thread but if someone is searching and comes here....

    If you want to have a server side validation, return the id of your checkboxgroup in the json errors :

    Code:
    {success: false, errors: {"idCheckboxGroup":"Some error message"}}
    Thus, the checkboxgroup is mark as invalid and the error message is displayed in the way you have set the msgTarget of the checkboxgroup.

Posting Permissions

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