I have requirement in that I want to show a dropdown values. So to achieve this I created a form function with select
type and returning the form. I want to display it in a html page. Here is what I have tried:
function cart_confirmation_form($form, &$formstate){
$opt = array('Hi','Bye');
$form['dropdown'] = array(
'#title' => 'somethinfg',
'#type' => 'select',
'#options' => $opt,
);
return $form;
}
function testing(){
$message .= '<div class="popup-related-tabs" style="float: left;" >' . cart_confirmation_form($form, $formstate) . '</div>';
$message .= '<div class="popup-related-titles" style="padding:15px;" id="popup-related-block">'.$form_message.'</div>';
drupal_set_message('<div class="message-inner" style="padding:15px;">' . $message . '</div>' );
}
This is not working, It says array to string conversion, form and formstate is undefined something like this. I know this is not correct way please suggest me the correct way to print values in dropdown.