Use the nightly build of struts, this was fixed on Sept 9. Please let me know if it works for you.
-Rob
Hi,
I have some problems validating multiple radio buttons and checkboxes, selections on the client side. Tracking down to the javascript code defined in validator-rules.xml, I found that the validateRequired(form) function doesn't deal with multiple checkboxes, selections at all. For multiples radios, checkboxes etc, the field.type = undefined. Can somebody explain why is this?
Thanks,
Saul
Validator-rules.xml:
-----------------------------------------------------------------
function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oRequired = new required();
for (x in oRequired) {
var field = form[oRequired[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
}
} else {
value = field.value;
}
if (trim(value).length == 0) {
if (i == 0) {
focusField = field;
}
fields[i++] = oRequired[x][1];
isValid = false;
}
}
}
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
}
return isValid;
}
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

