View Issue Details

IDProjectCategoryView StatusLast Update
0006605mantisbtjavascriptpublic2016-11-22 09:50
Reportermlovell Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Product Version1.0.0rc5 
Summary0006605: Javascript form validation
Description

Is Mantis considering any type of client-side form validation? The server-side checks must remain, of course, but a little JavaScript can improve the user experience (no fussing about with back buttons and form expiration).

I have looked at several open-source issue trackers recently and have been most impressed with Eventum's form validation: http://dev.mysql.com/downloads/other/eventum/

I like Mantis better, of course, and picked it for our internal tool. :)

Additional Information

The Eventum solution seems fairly typical of form validation. From my cursory examination, it seems to involve the following:

  1. Each form field (table row) includes a caution sign .gif file, initially hidden.

  2. Each form includes some dynamically-generated JavaScript, specifying which form fields are required. In Eventum's case, the required list appears to be an array of objects, each of which specifies the field name and, for select boxes, an index corresponding to "empty".

  3. The form submission button first calls a validation routine. This validation routine traverses the list of required fields and ensures each of them has been set. If a required field has been left blank, then

    a) the hidden caution sign is made visible
    b) the field background color is turned reddish
    c) an alert box tells the users which fields must be entered

Eventum also has some additional code present which turns the field background back to white (and hides the caution sign) once something has been entered.

If there is interest, I may be able to contribute code.

TagsNo tags attached.

Relationships

related to 0021944 new Show all errors at once on an incomplete webform 

Activities

There are no notes attached to this issue.