⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

locked fields



francisco
  • profile picture
  • Member

Posted 08 February 2012 - 01:26 AM

is there any way to disable a field (or multiple fields), during the upgrade, depending on the value of some other field?

explaining better, have a table with their records, and one of the fields, determines if in the front end, if that record may be locked for editing some fields ...

there is a possibility?

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 10 February 2012 - 06:39 AM

You can do this actually with the set_rules . The use of the set_rules method works exactly the same way as codeigniter's set_rules ( http://codeigniter.c....html#callbacks ) from form_validation.

You can have a custom callback and there have your rule for the field. So every time the validation fails the user will prompt with a specific custom error and will NOT save the record into the database until everything goes well.