Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jan 26, 2011 @ 14:51
    Tom Fulton
    0

    Make a CheckBoxList Mandatory

    Hi,

    It seems that you can mark a CheckBoxList as mandatory, but the user can submit the form without checking any options.  I'd like to force them to check at least one option.  Any thoughts on how to achieve this?

    I see in the Shared Source the CheckBoxList inherits from a custom control called ValidateableCheckBoxList, so I would think this was already thought of, but doesn't seem to be working

    Any ideas?

    Thanks,
    Tom

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jan 26, 2011 @ 15:27
    Tom Fulton
    0

    Upon further investigation, the mandatory option does work, but not right away.

    For example, if you have a textbox and a checkboxlist, both marked as mandatory, and click Submit, the form reports the Textbox is mandatory, highlights it in red, etc - but ignores the checkboxlist.

    If you then fill out the textbox and click submit, then the checkboxlist is validated. 

    Is there some type of client side validation going on first maybe, that doesnt support the checkboxlist?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jan 31, 2011 @ 14:38
    Tom Fulton
    0

    It does look like there is some client side validation happening first, which does not include the checkboxlist (confirmed with Fiddler).

    Any easy way to make the client side validation support checkboxlists, or maybe even disable the client side validation for a given form?  Client is complaining - have a rather lengthy form that has a checkboxlist getting validated separately from the other fields.

    Thanks,
    Tom

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 25, 2011 @ 16:00
    Tom Fulton
    0

    Bump...any ideas on fixing or working around by maybe disabling the client side validation?

Please Sign in or register to post replies

Write your reply to:

Draft