NAME
HTML::Widget::JavaScript - Adds JavaScript validation to HTML::Widget
VERSION
Version 0.01
SYNOPSIS
This module adds JavaScript field validation for HTML::Widget objects.
When a JavaScript checked constraint fails, an alert box with the given error message (set by the message()
constraint method) is displayed.
Currently, these constraints are implemented in JavaScript: All, AllOrNone, Any, ASCII, Email (simplified), Equal, HTTP, In, Integer, Length, Printable, Range and String.
In other words, these constraints are missing: Date, DateTime, Time and Regex. Note that, although JavaScript support is missing, they will continue to work using server-side validation.
METHODS
See HTML::Widget.
$self->result( $query, $uploads )
$self->process( $query, $uploads )
After finishing setting up the widget and all its elements, call either process()
or result()
to create an HTML::Widget::JavaScript::Result. If passed a $query
it will run filters and validation on the parameters. The Result object can then be used to produce the HTML.
TODO
Implement the missing constraints.
Maybe add support for altering the error displaying behaviour (e.g. instead of using alert(), maybe we could fill the error span with the error messages directly through JavaScript).
AUTHOR
Nilson Santos Figueiredo Júnior, <nilsonsfj at cpan.org>
BUGS
Please report any bugs or feature requests directly to the author. If you ask nicely it will probably get fixed or implemented.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc HTML::Widget::JavaScript
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
SEE ALSO
COPYRIGHT & LICENSE
Copyright 2006 Nilson Santos Figueiredo Júnior, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 83:
Non-ASCII character seen before =encoding in 'Júnior,'. Assuming CP1252