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>


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s