1

I want to add hint to the CRUD form but I receive error.

 $temp_crud->getElement('pin')->setFieldHint('the hint');
webelizer
  • 418
  • 2
  • 11

1 Answers1

1

simply add this to your Model:

$this->addField('my_field')->hint('this hint will show on the form');

Alternatively you can do

if($temp_crud->form) {
    $temp_crud->form->getElement('pin')->setFieldHint('the hint');
}
romaninsh
  • 10,606
  • 4
  • 50
  • 70
  • It doesn't work! Application Error: Method is not defined for this object Exception_Logic, code: 0 Additional information: class: Field method: hint arguments: 0: this hint will show on the form – webelizer Sep 12 '13 at 17:13
  • you need to do this inside your Model class. – romaninsh Sep 13 '13 at 13:02
  • another note is that you should do crud->form->getElement, but you must be mindful that crud->form does only exist if you click on EDIT button. – romaninsh Sep 13 '13 at 13:03
  • Roman, I add the first code to the model! but it doesn't work altough the second one must work... – webelizer Sep 13 '13 at 15:03