I am just starting out making my module and already running into 2 problems, I believe this is being cause because the form is in a block but I am not entirely sure. This is what I have in my .module file, as you can see I have the function to output the drupal message upon submission however it simply does not do anything. I also get this error when I have the variables in my function.
Notice: Undefined variable: form in zillow_block_view() (line 33
and
Deprecated function: Call-time pass-by-reference has been deprecated in drupal_load() (line 933 of C:\xampp\htdocs\drupal\includes\bootstrap.inc).
function zillow_block_info(){ $blocks['zillow_block'] = array( 'info' => t('Zillow Block'), ); return $blocks; }
function zillow_block_view($delta = ''){
$block = array();
switch ($delta){
case 'zillow_block';
$block['subject'] = t('Zillow Block');
$block['content'] = zillow_form($form, &$zinfo);
break;
}
return $block;
}
function zillow_form($form, &$zinfo){
$form['description'] = array(
'#type' => 'item',
'#title' => t('Get your mortgage rates'),
);
$form['rates'] = array(
'#type' => 'fieldset',
'#title' => t('Mortgage Rates'),
'#collapsiable' => TRUE,
'#collapsed' => FALSE,
);
$form['rates']['street'] = array(
'#type' => 'textfield',
'#title' => t('Street Address'),
'#default_value' => 'Street Address',
);
$form['rates']['city'] = array(
'#type' => 'textfield',
'#title' => t('City'),
'#default_value' => 'City',
);
$form['rates']['zip'] = array(
'#type' => 'textfield',
'#title' => t('Zip Code'),
'#required' => TRUE,
'#default_value' => "Zip Code",
'#description' => 'Please enter your zip code',
'#size' => 5,
'#maxlength' => 5,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Submit',
);
return $form;
}
function zillow_submit_info($form, &$zinfo){
drupal_set_message('this is the info the form has submitted. zipcode=@zipcode',
array('@zipcode'=>$zinfo['values']['zip']));
}
any help is appreciated.