Edit report at http://pear.php.net/bugs/bug.php?id=5308&edit=1

ID: 5308
Updated by: [email protected]
Reported By: maarten at xolphin dot nl
Summary: Javascript Validation with Ajax
Status: Open
Type: Feature/Change Request
Package: HTML_QuickForm2
Operating System: Irrelevant
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

For now, added means to run validation onblur / onchange, like in
DHTMLRulesTableless. Ajax can be plugged in, it will be easy enough if
using the above-mentioned HTML_AJAX and 'callback' Rule.

HTML5 validation can be used, but it isn't supported in IE and its
support looks half-baked in other browsers.

Previous Comments:

[2011-03-27 07:42:46] doconnor

Request #17842


[2011-03-27 07:22:32] doconnor

An alternative which may be more practical is a renderer which is aware

http://diveintohtml5.org/forms.html and

For simple cases such as required fields, simple regexp patterns, title
HTML5 can support this without the need for javascript.

$form->addElement('text', 'name');
$form->addRule('name', '[a-zA-Z]');

print $form; // On rendering, a pattern attribute is added to the name
field; or via
the DOM.


[2006-06-08 09:24:45] avb

Moving feature requests to HTML_QuickForm2.


[2005-09-06 05:29:50] xolphin

At the moment HTML_QuickForm uses some Javascript validation if wanted
on the OnSubmit of the form. This saves some time checking the form on
the server, but it looks nasty. The user has to read the alert created
by the JavaScript, and has to find the form element where the error is

Ajax is a development methodology focused on removing click and wait in
web applications. I won't explain it here, because there is already a
lot of information available on it.

I think Ajax can be used in HTML_QuickForm very good. With Ajax we could
get the folowing advantages:

- Validation code only has to be written ones, and is executed on the
server (without the need to submit anything). We don't need a php
validation seperate from a javascript validation anymore.
- Code can be checked realtime, while the user is filling in the form.
He can instantly see he has done something wrong. Of course this can be
made with normal JavaScript too, but Ajax makes it some easier.
- Auto completion can be done with realtime data, instead of auto
completion with static data which is already possible now.

A nice example of what can be done with Ajax can be found on
http://www.khelder.com/tutorials/smartvalidation/ . For better
clarification the form elements with errors can be colored for example
yellow or orange. But that is up to the developer.

I hope this is the right place to make such a suggestion, if this is
better of in another place, please let me know. I like the Ajax idea a
lot and if needed I am willing to code it into HTML_QuickForm. Below
some useful links with more info of Ajax.

Validation with Ajax:

Ajax information:

How Ajax works:

Ways to implement it:

Pear implementation:


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedApr 21, '11 at 11:40a
activeApr 21, '11 at 11:40a

1 user in discussion

Borz_off: 1 post



site design / logo © 2023 Grokbase