jQuery does have a validation plugin that allows you to update the form without needing to change the scripting code.
For example, if you have a form element that's required, with a minimum length of 2 characters, you could then do it with:
<input id="firstname" name="firstname" class="required" minlength="2">
Or, you can do similar without using scripting at all, by making use of HTML5 techniques.
<input id="firstname" name="firstname" required>
But because screen readers have a difficult time, we really should add a WAI-ARIA role to help them out too.
<input id="firstname" name="firstname" required="true" aria-required="true">
You can also style your HTML5 required elements and whether they are valid or invalid with: