2019-01-08, 09:13 PM
I'm creating an "edit field" form for my plugin and i want to know how can i have a default selected option on it. Right now i am doing this:
Merge of $field with the $mybb->input
Where $field is an array with these values: name, description and definition. The last one is important because that's the one related with the select_box:
But, even though both text_box and text_area get to display their values, the select_box stucks with the default one: "string".
How can I solve it?
Thanks in advance!
Edit: Also, i will like to ask another thing. Is there a way to use the Form and FormContainer class in my plugn's functions? I want to create a custom form using the misc_start hook but it says that those two classes are not define:
Merge of $field with the $mybb->input
$mybb->input = array_merge($mybb->input, $field);
Where $field is an array with these values: name, description and definition. The last one is important because that's the one related with the select_box:
$form_container->output_row($lang->definition, "$lang->definition_desc", $form->generate_select_box('definition', array('string' => $lang->string, 'integer' => $lang->integer, 'tinyint' => $lang->tinyint, 'text' => $lang->text, 'boolean' => $lang->boolean), 'definition'));
But, even though both text_box and text_area get to display their values, the select_box stucks with the default one: "string".
How can I solve it?
Thanks in advance!
Edit: Also, i will like to ask another thing. Is there a way to use the Form and FormContainer class in my plugn's functions? I want to create a custom form using the misc_start hook but it says that those two classes are not define:
$form = new Form("misc.php?character=create", "post", "create_character");
$form_container = new FormContainer($lang->character_create);