Skip to content

Error display for RadioGroup and CheckboxGroup #21

Closed
dtb opened this Issue Jul 21, 2010 · 6 comments

2 participants

@dtb
dtb commented Jul 21, 2010

Radio and checkbox groups display errors after each individual element. They should be fixed to only display the error at the end of the group. There might be a use case where someone also wants to display an error near a specific option, but I'm not really sure. I would expect the default/easier way of specifying errors to put them after the group.

I fixed this in nestablish by overriding RadioGroup and CheckboxGroup to clear out the _messages['errors'] array element on the options it creates. See 29dae8bL16. This is likely not a good fix, but I didn't see any official way to remove or modify the errors or messages.

@Zeelot
Owner
Zeelot commented Jul 21, 2010

the solution would be for any radio or checkbox created by the group classes to 'find' messages in name.value instead of just name like all other elements... does that sound right to you? because a radiogroup of colors should put the error located at $errors[colors][red] under the red radio option (where the value is red)

let me know if that sounds logical to you guys

@Zeelot
Owner
Zeelot commented Jul 21, 2010

also, how are you setting _messages? it's protected

@dtb
dtb commented Jul 21, 2010

That sounds right to me.

Protected and private properties may be accessed by instances of the same class. It is a common mistake that people think that it must be the same instance of the class. See here.

@Zeelot
Owner
Zeelot commented Jul 22, 2010

quite interesting... not sure why I never questioned that part of my horrible college education

@Zeelot
Owner
Zeelot commented Aug 12, 2010

this seems to only be an issue on radioGroup, not checkboxGroup

@Zeelot
Owner
Zeelot commented Aug 12, 2010

changing the path that radio buttons use, closed by b401f69

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.