Allow reset button to ignore form validation

I am using the below JavaScript to validate a form field when information is entered and it is trigged on blur. When the user clicks the reset button, this javascript still runs and the validation error appears. Can someone help me make the reset button truly "reset" the page and all validations? Thank you.
function CheckIt(ID)
{
  var cfcAsAjax = new jsobj();
  x = cfcAsAjax.Checkthenum(ID);
  
  if (x==true) {
    document.getElementById('labelthenum').innerHTML = '<span>The Number:</span>';
  } 
  else {
    document.getElementById('labelthenum').innerHTML = '<span>The Number:</span><br><span class="red"><strong>Please enter a valid number</strong></span>';
    document.getElementById("thenumNumber").focus();
  }
}

Open in new window

earwig75Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
You will need to provide more code than that. We need to see the markup for the form as well as the mechanism for triggering the validation.
0
earwig75Author Commented:
<label for="thenumNumber" id="labelthenum">Incident Number: </label>

<input type="text" name="thenumNumber" ID="thenumtNumber" onBlur="CheckIt(this.value)" maxLength="12"  value="">

Open in new window

0
Julian HansenCommented:
@eerwig75 - that is still not helpful. Where is the reset button markup? Given that is central to your question it is important that we see it in context. In addition there are often side effects in code that are not evident unless you are looking at all the code.

Is there a reason you are not posting a full listing of form + javascript?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

earwig75Author Commented:
The reset button is just a standard reset button.
I ended up just allowing the focus to leave the field if it is blank.
0
Mukesh YadavFull Stack DeveloperCommented:
May you share entire html and js?
0
earwig75Author Commented:
I shared all I can and what I feel is important. If it's not enough I guess I will close the question.
0
Julian HansenCommented:
Make your CheckId execute on Form submit instead of blur.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.