Hello,

I have a function , below , which I use to validate text boxes on an ASP page.
I need to the function to validate a List / Menu.
Does anyone know how I need to change the function below to cater for this?
Any ideas , please send them on.
Thanks
Dave

#########################################


//This function checks the required field and makes sure that user input some data in those and it is not just empty spaces
function CheckReqField(strFormName, strReqParam){
var blnReturn = true;
for (var i=0;i<eval(strFormName).length;i++){
if (eval(strFormName).elements[i].name.substr(0, strReqParam.length) == strReqParam){
var strTemp = Trim(eval(strFormName).elements[i].value);
if (strTemp == ''){
blnReturn = false;
}
}
}

if (blnReturn){
eval(strFormName).submit();
}
else{
alert("Please fill out all the required fields before submitting the form.");
}
}

//This function takes out all the spaces from a string from both sides and the middle and returns the result.
//It is used in conjunction with the above funtion to make sure the user simply didn't put it spaces in the input text field
function Trim(strInput){
var strTrimmmed = '';
for (var i = 0;i<strInput.length; i++){
if (strInput.charCodeAt(i)!=32){
strTrimmmed += strInput[i];
}
}
return strTrimmmed;
}