CodeIgniter Forums
Get info from Validation Module - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forum-22.html)
+--- Thread: Get info from Validation Module (/thread-48336.html)



Get info from Validation Module - El Forum - 01-12-2012

[eluser]justmelat[/eluser]
We've inherited a codeigniter app, basically an auto-generating form. We want to try something different with the "required" fields but I need to know which fields has been flagged as required. Because of the validation module that codeigniter uses, the fields don't show in the code which one are required. Is there a way, using the onload event, and referencing the validation code to pull all fields that have been mark as required, in to an array?

So in short:

user creates form, [form design page has checkbox that lets user select which fields are/are not required],
open the new form page,
go to validation module,
generate list/array of fields[id's] that are required.

Can this be done, if so how?