I have a custom model containing two paths. Each path goes to the same function. I wanna to send to each page arguments specific parameter and reception on the function then pass the hidden value to submit function.

  $items['parkingcalculator_normal'] = array(
    'title' => t('Parking calculator'),
    'description' => 'Parking Calculator Page',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('parkingcalulator_form',0),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  $items['parkingcalculator_valet'] = array(
    'title' => t('Parking calculator'),
    'description' => 'Parking Calculator Page',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('parkingcalulator_form',0 ),
    'access callback' => TRUE,
  );
function parkingcalulator_form($form, &$form_state , $type){...}

but the function does not take the parameter and does not pass the value in the hidden form type to

function parkingcalulator_form_submit($form, &$form_state ,$type)
up vote 1 down vote accepted

Remove $form from the submit function and just keep the $form_state.

The function would look like

function parkingcalulator_form_submit(&$form_state ,$type)

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.