Resulting object of this register form can be seen below..
http://paste2.org/p/134046

Updated the link: database info was incorrect apologies...


On 22 Jan 2009, at 18:12, Craig Fairhurst wrote:

Jeramy

Interesting you raise this topic, as of December last year I have been tackling this problem head on.

The Project:
        Automatic Form Generation with Client and Server Side Validation

Key Problems:
        Extensibility
        PHP Object Structure
Keeping complete control of the Style/Layout of the form independently of the PHP Object
        Validation Syntax - what to base it upon?
        
Ongoing Concerns:
        Outputting validation based upon answers provided in the form

Solutions:
Extensibility - Use only one function for adding form items and determine what field type to process from the first parameter PHP Object Structure - Based upon W3C DOM Form Markup; form fields are registered to form fieldset. Form fieldset contains own properties. Style/Layout - Combination of the correct XHTML Form Markup with unique ID's on the key element containers gives complete Style and Layout control through CSS Validation Syntax - Pseudo Syntax based mainly upon the Mootools FormCheck sytax, due to lack of docs and knowledge on validators.xml

Key Features:
Form Generation and Validation is done from inside the Base View for the Project Module. The function can then be called from inside the view itself.

Working Example
The project is undergoing development and is being used within a site I'm currently working on, see link below.
        http://devel1.gosnews.info/register
        
gosnewsUsersBaseView.class.php
See: http://php.pastebin.com/m31b6b96c

RegisterInputView.php
http://php.pastebin.com/m486190c5

RegisterInput.php
http://php.pastebin.com/m3861462e

I've not progressed any further with fields such as Image Captcha and so on but if there was enough community support this could potentially be a good open-source forge project for people to contribute additional features and options.

Thoughts???



On 21 Jan 2009, at 17:13, Jeramy Wenserit wrote:

Afternoon,

I've been asked to enquire whether the following concept is possible,
we have some realtime Javascript validation on a web-form, but instead of having the error messages stored in two locations (in the js script and in the validation's action.xml file), is it possible to centralise
these messages just into the Agavi's module/<modulename>/validate/
action.xml file.

Then in the input view class, have the XHTML function call (i thinking
out loud) request the validation xml file, the file name could be
passed by the action to the view with an attribute setting or so.

Can I use the validation Manager in the action/view to gain all the
possible error messages, then parse them to JSON and print it to a JS
variable or so.

...or should I use Agavi Configuration interface to load in the
validation xml file and return a structure PHP data type/object which
can then be parsed into JSON.

Cheers folks,

Jeramy Wenserit (E_mE)
e: [email protected]



_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to