﻿
function SubjectsSelectorValidatorEvaluateIsValid(val)
{
  var v = ValidatorGetValue(val.DropDownId); 
  
  if (v == '0')
  {
    Get(val.ddlErrorLabel).innerHTML = "&nbsp;- Required";
    return false;
  }
  else
   Get(val.ddlErrorLabel).innerHTML = ""; 
  
  if (v == '-1')
  {
    v = trim(ValidatorGetValue(val.TextBoxId));        
    
    if (v == "")
      Get(val.txtErrorLabel).innerHTML = "&nbsp;- Required";
    else
      Get(val.txtErrorLabel).innerHTML = "";
  }
    
  return !(v == "");  
}

function trim(stringToTrim) 
{
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

