my code :<br><br><?php<br>function my_form($param1, $param2, $form_values = NULL) {<br> // Build the fields that stay the same from form to form...<br><br> $form['title'] = array(<br> '#type' => 'textfield',<br>
'#title' => t('Quiz title'),<br> '#required' => TRUE,<br> '#default_value' => 'My quiz',<br> );<br><br> // The current number of questions, plus three more if<br>
// the user requested them.<br> if (isset($form_values)) {<br> $question_count = $form_values['question_count'];<br> <br> if ($form_values['op'] == t('More questions')) {<br> $question_count = $question_count + 3;<br>
}<br> }<br> else {<br> $question_count = 3;<br> }<br><br> $form['question_count'] = array(<br> '#type' => 'hidden',<br> '#value' => $question_count,<br> );<br><br> // We'll loop from 1 to n, where n is the current number of questions to<br>
// be displayed.<br><br> for ($i = 1; $i <= $question_count; $i++) {<br> $form['question_' . $i] = array(<br> '#type' => 'textfield',<br> '#title' => t('Question !count', array('!count' => $i)),<br>
);<br> }<br><br> // This part is important!<br> $form['#multistep'] = TRUE;<br><br> $form['more'] = array(<br> '#type' => 'button',<br> '#value' => t('More questions'),<br>
);<br> $form['submit'] = array(<br> '#type' => 'submit',<br> '#value' => t('Submit'),<br> );<br><br> return $form;<br>}<br><br>function my_form_submit($form_id, $form_values) {<br>
<br> for ($i = 1; $i <= $form_values['question_count']; $i++) {<br> drupal_set_message($current_question = $form_values['question_' . $i]);<br> // Process $current_question<br> }<br> //return 'node/1'; // set redirect after submission, if desired<br>
}<br><br>print drupal_get_form('my_form', 1, 2);<br>?><br><br>When i run the site i got error like<br><br clear="all">
<b>Fatal error</b>: Unsupported operand types in <b>C:\Program Files\xampp\htdocs\cancom\includes\form.inc</b> on line <b>342<br><br></b>-- <br>Regards<br>B.S.Bharanikumar<br><br>POST YOUR OPINION <br><a href="http://bharanikumariyer.hyperphp.com/">http://bharanikumariyer.hyperphp.com/</a><br>