Radio buttons / Checkbox list

Aug 20, 2009 at 11:20 AM

In my project I'm trying to use the xVal features for validating input data from user, but I don't know how to define the proper fields and what atributes to set to make it work. In model I have a enum variable that represents the possible choises (with { get; set; }). I came up with two problems:

  • the jQuerry validation does not trigger (are the radio buttons and checkbox list supported by jQuery.validate)?
  • second problem is that the value is always set (limitations of { get; set; }) so even if no value form form is send it validates.

Does anybody have a good working solution for it? Or good idea how to make it?

Ps. I'm using DataAnnotation Validation (thinking on swithing to Castle Validator).

Ps2. I'm using a UpdateModel or a model as a param for action methed to populate data from form  so I would like to avoid a string fields with [Required] atribute, and some moethod to set a valu on my enum by some value casting.

Regards.