
This lightweight form alert 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.
Call the function as follows…
inlineMsg('name','You must enter your name.',2);
The first parameter is the id of the element you wish to display the
warning in relation to. The second is the string you wish to display in
the message box. You can include HTML, just be sure and escape when
necessary. The third parameter is the time to display the message in
seconds. It is optional and if left empty will default to the MSGHIDE
variable in the JavaScript which is initially set to 3.
This has been tested working in IE6/IE7/IE8, Firefox, Opera and Safari. Please report any bugs to michael@leigeber.com.
Click here for the demo.
Click here to download the source.