⚠ 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

Input type radio on form add and update



eamon250d
  • profile picture
  • Member

Posted 03 January 2016 - 06:06 AM

hi,

I wonder if anyone has used a field type sex for inserting and updating.

It works for insertion.

$crud->callback_add_field('Sex',array($this,'add_field_sex'));

function add_field_sex()

{

                                   return '<input type="radio" name="EleveSex" value="Madame"/> Madame 

                                   <input type="radio" name="EleveSex" value="Monsieur"/> Monsieur';

}

One idea for the update form ?

 

 


Amit Shah
  • profile picture
  • Member

Posted 06 January 2016 - 02:07 AM

instead of doing callback_add_field. .. u can use the same using callback_field or u can also make a callback for edit field

 

A better way - set it as field_type - enum - that gives you nearly the same result and it is handled directly by Grocerycrud library

 

Happy GCing:)