Please, i need validate on web a dialog list field that permit multiple values,this field take the values of others field in the form depending selection, but when i validate with javascript It is not available.Do you know other form to validate this field. thanks. I use the next formula:
var f = document.forms [0]
var numSelected = 0;
var i;
for (i = 0; i < f.Revisores.length; i++)
{
if ( f.Revisores.options[i].selected)
numSelected++;
}
if (numSelected > 5)
{
alert("Please select ");
f.Revisores.focus();
return (false);
}
if (numSelected < 1)
{
alert(“Please select…-------.”);
f.Revisores.focus();
return (false);
}
Subject: validate on web
since its a multiple value list, you have to use the selectedindex method
Subject: RE: validate on web
How does this field display in the browser, as a combobox or checkboxes or a plain text field or what? Look at the HTML source – what is the HTML for this field?
I don’t know what “it is not available” means. Do you get a Javascript error message? What is the error message, and on what line does it occur? What does this code do that is different from what you expected?
Are you certain the code that you are showing us is executing? Can you put in an alert(…) line before you get into the loop so that the alert will show you that it gets to that line?
Where is your return(true)?