Closed rolandtoth closed 8 years ago
Sorry, I don't have time to deal with this, so if you can make it work and provide pull request, that would be great.
Maybe it's because internally I'm using old netteForms.js (I haven't checked lately if there were any changes) or it just needs special handling of these *List elements.
Ok, I will get into this when I'll have some time.
If I replace the NetteForms.js part in the code, the problem still exists. Maybe it's in the original code? I have no Nette projects where I can try this (using Nette Forms as standalone).
Here is a quick fix but I'm not sure how general is it: https://github.com/Robyer/nette-live-form-validation/compare/master...rolandtoth:patch-1
This finds the first error message tag and empties that.
I don't understand why are there several error messages on RadioList/CheckboxList controls and not just only one. Is this by design? Can a radio or a checkbox item validated individually in RadioList/CheckboxList controls?
I don't understand why are there several error messages on RadioList/CheckboxList controls and not just only one.
Because LiveFormValidation wasn't prepared for that (when original author created it, such elements wasn't supported in Nette).
I pushed correct fix, along with updated internal netteForms.js.
Try version 1.7.0 :)
Thanks, seems to work fine at first sight.
Btw, the error message IDs for multi elements start with "-" (eg. "-areas_message"). Is this intentional? Looks weird but according to the specs it should be valid in HTML5.
Btw, the error message IDs for multi elements start with "-" (eg. "-areas_message").
Does your form has ID? I'm creating new id as formId + "-" + elemName.
No, there's no form ID.
So that's the reason. But Nette by default gives every form an ID, you have it intentionally without it?
I guess that's because I use Nette Forms standalone. I see there's a "frm-..." ID when using the framework. Maybe you could add "frm" prefix if there's no ID?
What ID do you see for your inputs (e.g. if you have name="areas")? I can use "frm" or no prefix at all. I'm not sure what's better.
Here you can view the form: http://mosolygo.paqartdesign.com/en/contacts/be-our-volunteer/
Aha, I think it would be better (and safer) to use ID for your forms. Maybe it will also automatically prefix all your input ids (as FW does it)?
Anyway, I'll keep it without "frm" prefix for now.
All right, thanks for your inputs :) No, there's no auto prefixing when there's an ID but that no problem.
When using RadioList or CheckboxList, the validation error goes away only if I select the first input. Also, the error spans doesn't populate, except the first one (but maybe this is intentional).
I'm using the default renderer:
Am I doing something wrong?