Skip to content

Instantly share code, notes, and snippets.

@ndusan
Created April 19, 2012 21:29
Show Gist options
  • Save ndusan/2424336 to your computer and use it in GitHub Desktop.
Save ndusan/2424336 to your computer and use it in GitHub Desktop.
$(document).ready(function(){
$('body').delegate('form', 'submit', function(){
var allOk = true;
$('.jr').each(function(){
if($(this).val().length <= 0 || $(this).attr('title') == $(this).val() || $(this).attr('title') == $(this).html()){
$(this).addClass('warning');
allOk = false;
}else{
$(this).removeClass('warning');
}
});
if(!allOk) return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment