⚠ 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

Set value hidden/invisible field



Julio

Julio
  • profile picture
  • Member

Posted 24 May 2013 - 01:52 AM

Hi,

 

How can I set value for a field that will not appear in the form?

I need to set a value for update operation hidden from the user.

 

Thanks


davidoster

davidoster
  • profile picture
  • Member

Posted 24 May 2013 - 06:07 AM

When you $crud->field_type('office_id', 'hidden', $office_id);

you use the third parameter of the function to store a value to the field.

This works only for:

 hidden, enum and set field and it is not a default value for all the other types.

 

Read the manual here.


Julio

Julio
  • profile picture
  • Member

Posted 24 May 2013 - 14:34 PM

Thanks for your reply David.

I'm newbie with GC, i would like to understand how it works the integration of GroceryCrud with CodeIgniter.
Let me try to explain....

How can i call my CI functions from GC methods?
I meam i'm executing a GC insert or update operation and also execute some other function that make an update or some insert table data in my CI code.

How does it work this kind of integration? Using callbacks, set_action or is there another way?

davidoster

davidoster
  • profile picture
  • Member

Posted 25 May 2013 - 05:01 AM

Most of the times it will be a callback.

But it all depends on the logic of your app.