Dynamic JavaScript Form Validation

By Michael Leigeber on Jan 26, 2009


This lightweight form validation script allows you to easily add attractive validation messages to your forms. There is no markup to add on your existing page. Just call the inlineMsg() function when you wish to display a message. The position of the form element (or any other element) is dynamically calculated.

See the demonstration here.


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: messages.js


Paste this code into your external CSS file or in the <style> section within the HEAD section of your HTML document.


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document


Download the images using the URL below:

  • Download the images here


Blog comments powered by Disqus