Skip to content

Instantly share code, notes, and snippets.

@tkjaergaard
Created July 10, 2012 07:31
Show Gist options
  • Select an option

  • Save tkjaergaard/3081823 to your computer and use it in GitHub Desktop.

Select an option

Save tkjaergaard/3081823 to your computer and use it in GitHub Desktop.
Jquery validate function
function validateStep()
{
var validated = true
$('[id*="step"]:visible .error').removeClass('error');
$('[id*="step"]:visible .required :input').each(function(){
if( $(this).val().length <= 0 || !$(this).is(':checked') )
{
$(this).parent().addClass('error');
validated = false;
}
});
return validated;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment