Jquery advance validations

// after seeing error when user start typing in the input box the message hides and border comes to original color 
 //call this method onclick of submit button
 function valid()
 //check if contest title is not empty or you can use regular expression comparision also
		if($('contest_title').val == ''){
		$('contest_title_err').html('Please enter contest title');
		noerror[0] = 1;
if(noerror[0] == 1 && so on for many fields)
			return true;
			return false;

// the html for the fields is		
<input type="text" class="form-control" placeholder="Title" id="contest_title"  name="contest_title">
<label id="contest_title_err" class="message error"></label>