⚠ 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

Hide Label



eamon250d
  • profile picture
  • Member

Posted 03 January 2016 - 05:52 AM

Hi ,

I have a field that stores the default registration date. I hid the form but the label field is always displayed. I wonder how I can hide the label too.

$crud->callback_add_field('Date_Inscription_Systeme',array($this,'add_field_date_systeme'));

 

function add_field_date_systeme()

{

                date_default_timezone_set("America/Montreal");

                $date = date('Y-m-d H:i:s');

    return '<input type=" hidden " maxlength="50" value="'.$date.'" name="phone" style="width:462px" readonly>';

}

 

 


Amit Shah
  • profile picture
  • Member

Posted 06 January 2016 - 02:12 AM

Well what you are dealing with this callback is exclusively for the field that GC generates automatically. You are just over riding the same. 

In case you need to hide the label - u can try display_as("field_name", "") .. that trick may work.

 

Else you may have to deal with js / css to do the trick.


eamon250d
  • profile picture
  • Member

Posted 13 January 2016 - 18:19 PM

The blank line is displayed and the colon too.

See image attached

Thank you

 

 

             ->display_as('EleveDateInscriptionSysteme','')
            $crud->callback_add_field('EleveDateInscriptionSysteme',array($this,'add_field_date_systeme'));
 

 

function add_field_date_systeme()
{
    date_default_timezone_set("America/Montreal");
    $date = date('Y-m-d H:i:s');
    return '<input type="hidden" maxlength="50" value="'.$date.'" name="EleveDateInscriptionSysteme"   readonly>';
    /*
    <input type="hidden"  value="<?php echo $result[0]["EleveDateInscriptionSysteme"]; ?>">
    */
}