By patjan on
Hi, I have difficulties passing additional arguments to drupal_get_form(). I need to pass an id that is submitted as part of a url to a form. Lately I have tried something like :
$trip = array('id' => $tripid,);
$form = drupal_get_form('transport_tripstageform',&$form_state,$trip); and tried to access the $trip array in the form as follows:
function transport_tripstageform($form_id,&$form_state,$trip=NULL){
// Display a message with the submitted value.
$tripid=$trip['id'];
drupal_set_message("going on $tripid");
}
This code consistently fails to show the value retrived from $trip.
Please help.
Comments
Where does $tripid id come
Where does $tripid id come from in the first chunk of code.
Change it to this:<?php$form
Change it to this:
Contact me to contract me for D7 -> D10/11 migrations.
Thanx Jay
Thank you very much, ur solution worked. I spent days working around this form, you saved the day.