My script works successfully when I validate a form field using;

<input type="submit" onClick="return chkrange(this.form)"

But, when I remove the onclick from the input type and try to use

onSubmit="return chkrange(this.form)" within the <form> tag it doesn't work

Why not?

Would have to see the form validation code to say.

Change the onSubmit version to just onSubmit="return chkrange(this)" . Inside the form tag, this already refers to the form.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.