Form Validation: How to wrap all errors in a single container? |
[eluser]momsenmeister[/eluser]
Hi, how is it possible to wrap all form validation errors in a single container? For example, how to display all form validation errors as a list? The error delimiter only allows to wrap each error separately. Thx!
[eluser]mi6crazyheart[/eluser]
As far as i know each error is wrap by HTML "Paragraph" tag. So, i don't think it cause any problem. If u want u can also manually keep all the errors in container... Ex: Code: if(validation_errors())
[eluser]michalsn[/eluser]
Maybe I misunderstood you, but you can use Code: <?php echo validation_errors(); ?> //edit @mi6crazyheart was a bit faster
[eluser]momsenmeister[/eluser]
Thx so far, but that's not quite what I'm looking for. Solution of mi6crazyheart is okay, but I want to define the output globally. So maybe a helper is the best solution? View: Code: <? echo wrapped_validation_errors(); ?> Helper: Code: function wrapped_validation_errors() Would that be a clean solution, or can you think of a better one? |
Welcome Guest, Not a member yet? Register Sign In |