I have a form implemented from hook_form called simplequiz_form () I want to access my data after submitting below, this is the code I wrote, but I can not access its data after submitting it. What am I doing wrong?
function simplequiz_form_validate($form, &$form_state) {
Below is my implementation of hook_form ()
function simplequiz_form($form, &$form_submit) { $form['question'] = array( '#title' => t('Please input your question'), '#type' => 'text_format', '#required' => FALSE, '#description' => t('Here is where you can enter your questions'), ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Submit', ); return $form; }
if i use $ form_state ['values'] ['question']
I get the following error:
PDOException: SQLSTATE [21S01]: the list of insertion values ββdoes not match the list of columns: 1136 The number of columns does not match the number of values ββin row 1: INSERT INTO {simplequiz} (questions) VALUES (: db_insert_placeholder_0_value ,: db_insert_placeholder_0_format); Array ([: db_insert_placeholder_0_value] => [: db_insert_placeholder_0_format] => filter_html) in simplequiz_form_submit () (line 245 from /home/vishal/Dropbox/sites/dev/sites/all/modules/simplequiz/simple.
it worked using $ form_state ['values'] ['question'] ['value']
source share