Jump to content


How to specify these fields

forms

  • Please log in to reply
2 replies to this topic

#1 gavin1211

gavin1211

    Member

  • Members
  • PipPip
  • 11 posts

Posted 04 April 2012 - 02:57 PM

How do you specify a field is:

1. A multi line input box
2. A wysiwyg editor as seen in some of the examples

Thanks

#2 KaBaDaBrA

KaBaDaBrA

    grocery CRUD magician

  • Members
  • PipPipPip
  • 57 posts

Posted 04 April 2012 - 03:12 PM


//EXAMPLE CALLBACK

$this->grocery_crud->callback_add_field('address',array($this,'add_field_callback_1'));



//EXAMPLE CALLBACK FUNCTION WITH MULTILINE FIELD

function add_field_callback_1()

{

      return '<textarea name="address" rows="15"></textarea>';

}





//EXAMPLE CALLBACK FUNCTION WITH TINY MCE EDITOR

function add_field_callback_1()

{

      return '<textarea name="address" class="texteditor"></textarea>';

}


Grocery CRUD - Categories and Subcategories - Demo and Step by Step here: http://demo.edynamic..._management/add

#3 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,101 posts
  • LocationLondon

Posted 04 April 2012 - 06:05 PM

or you can simply use the unset_texteditor for that.

For example:

$crud->unset_texteditor('description','full_text');

will unset the texteditor. The default text is WITH the texteditor.

If an input is a string and you want to transform it to text with texteditor you can simply do:

$crud->change_field_type('address', 'text');

You can read more about the change_field_type at: http://www.grocerycr...ange_field_type
Posted Image





Also tagged with one or more of these keywords: forms

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users