Posting in these forums is disabled. These forums will be available for archive purposes. Please join the new forums at the links below:
This support forum belongs to the Form Gallery Module.
Form has a bug tracker here: http://github.com/ghinch/yui3-gallery/issues
Page 1 of 1 | [ 4 posts ] |
I liked the component so I looked into it and thought about things I would like to see. This is my wishlist:
Group There should be FormFields and FormGroups. The abstract FormGroup would be the base for Form <form>, FieldSet <fieldset> plus <legend> and SimpleGroup <div> elements. The later would simply be a group meant to provide an enclosing container for formatting purposes. FormGroups can contain FormGroups and FormFields. Enclose label and field in a div It would make laying out easier if the label and the input field are within a div. className property A className to apply to the fields would be great. It should be applied to the div enclosing both the label and input control. Validator should accept Regexp The validator should take both a function and an instance of a regexp. In fact, most validators are nothing more than the same function with different regexp. rename US specific validators date should be dateMdy, postalcode should be USZip, phone should be USPhone. Or, better yet use localization instead of hardcoding it, but that might be tricky. Use object to store validators. Once you define the validators, store them in a hash indexed by their shortname, such as: Code:
Validators = {
dateMDY: VALIDATE_DATE, time,VALIDATE_TIME, .... } and so on. Then validating the short name for the validator is simply a matter of trying to access the property in this array and if undefined, it doesn't exist. Likewise, setting the validator is no longer a long set of if/else clauses. This also adds the flexibility of adding more validators. This hash should be a static property. See: http://developer.yahoo.com/yui/docs/YAH ... .Formatter add defaultValue property showError A good means of showing error messages is to add a className to the div containing both the label and input field in error. This would make it easy, for example, to add a padding on either side of the label and using a non-repeating background image, plus color changes, all done in CSS. In order to avoid disturbing the layout of the form, the error message could be shown as a tooltip when the cursor is placed on top of the label if the needed components are loaded, or in a div after the input field within the field container div otherwise. non-input fields Just plain text with no input whatsoever. |
Joe Developer
|
you might want to have a look at inputex : http://javascript.neyric.com/inputex/
yui 2.x mind you, but probably a lot of useful code which can be pulled in. |
Thanks for the suggestions Satyam, I've been a bit busy with my regular work and life in general and haven't had much chance to work on this since the holidays, but I'm getting back to it this weekend. This kind of feedback is great to have and I'll work on incorporating it!
|
Juan Ignacio DopazoYUI Contributor
|
Hey Greg!
I'm thinking about making a few modifications to gallery-form. At first I'll just send you a pull request with a couple of things missing from the docs (I'll try to rebuild the docs with the new template). Here are a couple of ideas that I'm considering:
|
Page 1 of 1 | [ 4 posts ] |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
All code on this site is licensed under the BSD License unless stated otherwise.
Powered by phpBB® Forum Software © phpBB Group