Welcome Guest, Not a member yet? Register   Sign In
Proposed changes to Form Validation
#1

[eluser]duellsy[/eluser]
I made some changes to the Form Validation library and Helper today, and submitted them to the github version of reactor to hopefully make it to the core with the following details:


2 main changes:
1st - Allow for a container around the errors displayed. I often find myself having to wrap the errors in a bounding container, figured it would better if it was just the way CI output the errors. This lets you have a ul as the full wrap, and each error pre/suffixed by li /li

2nd - Allow the developer to optionally choose which groups errors to display e.g., validation_errors('login')
This allows the developer to output specific group error messages at multiple positions on a single page should the page have multiple forms, rather than a single error dump location.
e.g., if you have three forms on the same page, this lets you display the errors for each form directly above the corresponding form rather than have them have to be displayed in the one generic area on the page.
Validation rules must be set via the config file in groups.


You can see the code changes here:
https://github.com/philsturgeon/codeigni...tor/pull/8
#2

[eluser]JasonS[/eluser]
I would rather see 'class="error"' added to the default prefix or be able to set the prefix / suffix in the configuration file. I could have sworn that you used to be able to do this... doesn't seem to be there any more.
#3

[eluser]Jaketoolson[/eluser]
I agree with both of you regarding this. It's annoying because setting delimiters only allows me to set them on an individual basis but no control of the entire group of errors.
#4

[eluser]duellsy[/eluser]
[quote author="Jaketoolson" date="1297913917"]I agree with both of you regarding this. It's annoying because setting delimiters only allows me to set them on an individual basis but no control of the entire group of errors.[/quote]
Exactly, a pet peev of mine, always had to do it separately so figured others might get use from this alteration... hopefully it makes it to the core and I'll never have to worry about it again Smile

Glad I'm not the only one!
#5

[eluser]duellsy[/eluser]
I've added a bit more documentation, and usage instructions here:

https://github.com/philsturgeon/codeigni...ent-779997




Theme © iAndrew 2016 - Forum software by © MyBB