[eluser]BilliamTheSecond[/eluser]
I need to run form_validation twice, and I'm not sure how to go about it.
The simple version:
I have a blog post. Blog posts can be in one of several categories. The post admin form has a dropdown with existing categories.
The validation rule for categories is something like is_natural_no_zero|exists[category.id]
The poster can select a category, or select 'create new', enter a new category name and have that created and assigned to the post at submit time.
So, when creating a new category in the add/edit blog post form:
The new_category_name field is required, and has some other rules.
If the new category passes validation, it's added ( $new_id = category_model->add($new_name) ), and the new category id is used for the post.
And _then_ the post is validated.
All help appreciated.