G
Guest
Hi all...
I'm trying to use a custom validator for a group of checkboxes in order to
validate that at least 1 checkbox is checked before submitting the form.
I placed 2 checkbox controls in the form and a CustomValidator. When I saw
CustomValidator properties, the checkboxes aren't listed in ControlToValidate
properties. Only textboxes are listed. Also, I set the ValidationGroup for
the checkboxes to a name such as grpTipoEnvio and that name didn't appear in
that list either.
The JavaScript function is implemented this way:
function ValidaCheck(source, arguments)
{
var arguments.isValid = false;
var len = source.length;
if( len && len > 0 )
for( var i = 0; i < len; i++ )
arguments.isValid |= source.checked;
else
arguments.isValid = source.checked;
}
Is it possible to use this control to validate checkboxes? if not, how can I
accomplish this?
Thanks a ot in advance
Jaime
I'm trying to use a custom validator for a group of checkboxes in order to
validate that at least 1 checkbox is checked before submitting the form.
I placed 2 checkbox controls in the form and a CustomValidator. When I saw
CustomValidator properties, the checkboxes aren't listed in ControlToValidate
properties. Only textboxes are listed. Also, I set the ValidationGroup for
the checkboxes to a name such as grpTipoEnvio and that name didn't appear in
that list either.
The JavaScript function is implemented this way:
function ValidaCheck(source, arguments)
{
var arguments.isValid = false;
var len = source.length;
if( len && len > 0 )
for( var i = 0; i < len; i++ )
arguments.isValid |= source.checked;
else
arguments.isValid = source.checked;
}
Is it possible to use this control to validate checkboxes? if not, how can I
accomplish this?
Thanks a ot in advance
Jaime