validate plugin. How to disable auto validation on keypress after submission for a given element.
I wish to be able to disable the automatic validation for one field/element only after submission how can this be done? I have looked at all the docs but cant work this one out.
- $.validator.addMethod("checkvalidIP", function(value, element, option) {
- return validateIP(value);
- },
- "Please check the IP Addresses you have entered."
- );
- $("#validateContact").click(function() {
- var errors = false;
- var firstError;
- $(".contact .required").each(function() {
- if(!$("#regForm").validate().element(this))
- {
- if (! errors)
- firstError = $(this);
- errors = true;
- }
- });
- var validateAuthenticationStep = function(){
- if ( ( $("#oldauthhiddenusername").val() != null && $("#oldauthhiddenusername").val() != '')
- || ( $("#oldauthusername").val() != null && $("#oldauthusername").val() != '')
- || ( $("#iprange").val() != null && $("#iprange").val() != '')
- || ( $("#username").val() != null && $("#username").val() != '')
- || ( $("#externalid").val() != null && $("#externalid").val() != '') )
- {
- var errors = false;
- $(".authenticationselectionerror").hide();
- $(".authentication .required, .authentication .checkvalidIP, .authentication .checkIPlocal, .authentication .email").each(function() {
- if(!$("#regForm").validate().element(this))
- {
- if (! errors)
- firstError = $(this);
- errors = true;
- }
- });
- if(errors)
- {
- firstError.focus();
- return false;
- }
- else
- return true;
- }
- else
- {
- $(".authenticationselectionerror").show();
- $(".authenticationselectionerror").css({'color': 'red'});
- $(".content label.error").hide();
- scroll(0,0);
- }