Comments (17)
I love the idea!
Would it have settings for placement (before/after), adding a class, appending/prepending, etc?
from cfwheels.
Yes. It would avoid the need to do stuff like this:
#textField(objectName="sale",
property="telMobile",
labelClass="control-label",
prependToLabel="<div class='control-group'>",
appendToLabel="<div class='controls'>",
append="#errorMessageOn(objectName="sale", property="telMobile", class="help-inline")#</div></div>")#
from cfwheels.
LOOOOOOOOVING THIS IDEA!!!!!
however I have some suggestions :)
- There needs to be some way to disable it if need be. Maybe an
error="false"
argument or something. - I would propose that errors be always outputted but have a
display:none;
style orclass="hidden"
. the reason for this, is that it would make it easier for devs (and us eventually) to use javascript for client side validation. by doing this the dev would simply need to remove the css styling to display the error message instead of having to recreate it with javascript. futhermore it would be nice to have classes on the errors to help recognize the errors like [objectName-propertyname] [validationtype] ie:
class="user-password confirmationof"
this way if more then one error existing, you can target it better with javascript.
thoughts?
from cfwheels.
- Yes absolutely.
- As with the label, the class on the element could be set via a prefix (e.g. errorClass="xx"). Visibility of the element could then be easily managed.
from cfwheels.
it would be impossible to do this manually. how would you set the errorClass for say two errors (confirmationOf and presitenceOf) on a password field. you can only pass in one errorClass argument to the passwordField() helper method.
from cfwheels.
What wheels should do is automatically add the [objectName-propertyname] [validationtype] class name to the errors and all the errorClass argument does is add your defined classes to each error. in other words, wheels would add:
class="user-password confirmationof"
to each error. if you set the errorClass argument to say tony
, then class attribute of the errors would be:
class="user-password confirmationof tony"
from cfwheels.
Doesn't errorMessageOn() only ever display one error per property?
from cfwheels.
errorMessageOn returns an array of all errors for that property:
https://github.com/cfwheels/cfwheels/blob/new-master/wheels/view/errors.cfm#L48
https://github.com/cfwheels/cfwheels/blob/new-master/wheels/model/errors.cfm#L97
from cfwheels.
That's errorMessagesFor()
Sent from my iPhone
On 15 Nov 2012, at 21:42, Anthony Petruzzi [email protected] wrote:
errorMessageOn returns an array of all errors for that property:
https://github.com/cfwheels/cfwheels/blob/new-master/wheels/view/errors.cfm#L48
https://github.com/cfwheels/cfwheels/blob/new-master/wheels/model/errors.cfm#L97—
Reply to this email directly or view it on GitHub.
from cfwheels.
Errormessagesfor gives back.an array of.all the.errors on the model.
Errormessageson gives back an array of errors for a particular property.
On Nov 15, 2012 6:19 PM, "Andy Bellenie" [email protected] wrote:
That's errorMessagesFor()
Sent from my iPhone
On 15 Nov 2012, at 21:42, Anthony Petruzzi [email protected]
wrote:errorMessageOn returns an array of all errors for that property:
https://github.com/cfwheels/cfwheels/blob/new-master/wheels/view/errors.cfm#L48
https://github.com/cfwheels/cfwheels/blob/new-master/wheels/model/errors.cfm#L97
—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/107#issuecomment-10430197.
from cfwheels.
http://cfwheels.org/docs/1-1/function/errormessageon
from cfwheels.
my bad, I should have said errorsOn.
from cfwheels.
This is plugin material :)
from cfwheels.
I actually think Chris Peters bootstrap form helpers plugin has this:
https://github.com/liquifusion/bootstrap-cfwheels
from cfwheels.
simple_form for Rails provides this. Their way of configuring forms is pretty nice, and I like that they have a generator for Bootstrap (though I wish there was one for Foundation too).
from cfwheels.
I stand corrected: looks like they finally made a generator for Foundation 5.
from cfwheels.
Closing this as we're using the issue tracker for bugs only from now on.
Please implement your feature suggestion as a plugin or make a pull request.
If you need feedback before starting, please consult the Google Group.
Thanks.
from cfwheels.
Related Issues (20)
- Don't reload js/css from the internet HOT 1
- Tests with failures return 417 HOT 2
- Valid request throws 404 HOT 2
- Race condition in unlocked application-scope usage HOT 2
- Race-time condition from core layouts.cfm HOT 8
- /wheels/controller/rendering.cfm response trimming response HOT 3
- Unhelpful error handling in /wheels/model/adapters/Base.cfc
- Docker volume (adobe) causing exception in development/testing HOT 1
- Two foreing key to same table wrong join on second key HOT 6
- Cache item tagging HOT 1
- `excludeFromErrorEmail` usage does not match documention
- Error generating a new app HOT 4
- `reload` process does not restart the application properly
- Failing to initialize model with database table including special column types
- In the API documentation inform that subqueries are not allowed in the WHERE clause HOT 3
- updateAll() is missing JOIN statement(s) when passing a value for the include argument HOT 1
- Minor pen vector in maintenance mode handling (1.4.x -> 2.2x)
- New CFWheels user HOT 1
- AJAX tutorial documentation improvement HOT 1
- AJAX tutorial documentation dead link
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cfwheels.