Hi everyone,

I am trying to run the following script to validate if textbox 'vSurveyAnswer[1].answer' is empty ONLY if the 'groupid' equals 542. I can't seem to get this to work, it validates regardless. Any help would be great. I also need to be able to validate other text boxes when the groupID is a different number (groupID comes from a querystring parameter)

Code:
$(document).ready(function(){
  $('#continueResBtn').click(function() {
  if($("#groupid").val() === "542"){
	if ($("input[name='vSurveyAnswer[1].answer']").val().length === 0){
      alert('Please Enter Start Date');
       return(false);
  }
  else return(true)
}
});
});
Thanks!!