how to add field of db in add form with some default value
- Single Page
Posted 09 April 2016 - 09:06 AM
Posted 12 April 2016 - 07:22 AM
I think you have to insert a callback and manually generate the field with all you need (html too).
# callback in the main function
$crud->callback_add_field('n_prop_spesa', array($this, '_aggiungi_documento'));
Then ... (end part of the callback function)
# crea la stringa di ritorno con il valore del campo numero proposta di spesa compilato
$stringa_di_ritorno = '<input type="text" maxlength="50" value="' . strval(++$row["numeretto"]) . '" name="n_prop_spesa" style="width:462px">' . "\n";
//return a string like ... '<input type="text" maxlength="50" value="1111" name="n_prop_spesa" style="width:462px">';
return ($stringa_di_ritorno);