HTML-FormHandlerX-JQueryRemoteValidator

 view release on metacpan or  search on metacpan

lib/HTML/FormHandlerX/JQueryRemoteValidator.pm  view on Meta::CPAN


    has '+jqr_validate_options' => (default => sub {$jqr_validate_options});

=head2 Class (form) attributes

=head3 C<validation_endpoint>

Default: /ajax/formvalidator

The form data will be POSTed to C<[validation_endpoint]/[form_name]/[field_name]>.

Note that *all* fields are submitted, not just the field being validated.

You must write the code to handle this submission. The response should be a JSON
string, either C<true> if the field passed its tests, or a message describing
the error. The message will be displayed on the form.

The synopsis has an example for Poet/Mason.

=head3 C<jquery_validator_link>

Default: http://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js

You can leave this as-is, or if you prefer, you can put the file on your own
server and modify this setting to point to it.

=head3 C<jquery_validator_opts>

Default: {}

A HashRef, keys being the keys of the C<validate> JQuery validator call documented
at L<http://jqueryvalidation.org/validate/>, with values being JavaScript functions
etc. as described there.

=head3 C<skip_remote_validation_types>

Default: C<[ qw(Submit Hidden noCAPTCHA Display JSON JavaScript) ]>

A list of field types that should not be included in the validation calls.

=head3 C<skip_all_remote_validation>

Boolean, default 0.

A flag to turn off remote validation altogether, perhaps useful during form development.

=head2 Field attributes

=head3 Tag C<no_remote_validate> [C<Bool>]

Default: not set

Set this tag to a true value on fields that should not be remotely validated:

    has_field 'foo' => (tags => {no_remote_validate => 1}, ... );

=head1 See also

=over 4

=item L<http://www.catalystframework.org/calendar/2012/23>

=item L<http://alittlecode.com/wp-content/uploads/jQuery-Validate-Demo/index.html>

=item L<http://jqueryvalidation.org>

=back

=head1 ACKNOWLEDGEMENTS

This started out as a modification of Aaron Trevana's
HTML::FormHandlerX::Form::JQueryValidator

=head1 AUTHOR

Dave Baird <dave@zerofive.co.uk>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by David R. Baird.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut



( run in 1.843 second using v1.01-cache-2.11-cpan-39bf76dae61 )