I've created a View (displays as page titled 'FindLawyer') that displays contact info for a lawyer (a CCK node type, with a Taxonomy field called Territory (vocabulary contains terms such as California, Arizona, New York, etc etc). I've added the Taxonomy term as an argument for the view, so "www.mysite.com/FindLawyer/California" displays the lawyer(s) in California. The view works fine.
I've created a Form in a block where the user can enter the territory they are searching for in a text field. The text field uses Autocomplete_taxonomy to suggest the territory name as the user types it in. And then the submit button takes the user to : www.mysite.com/FindLawyer/**entered territory here**
The idea is to create a kind of limited search on a specific CCK field...
The problem I'm having is in how to pass the contents of the text field as Argument1 in the url... (In the code below, 4th line from the bottom "????" is where the problem is - I don't know what the $form_value label is/should be...
here's my code for building the form:
function find_a_lawyer() {
$form['taxonomy']['tags'][$vocabulary->vid] = array(
'#type' => 'textfield',
'#default_value' => $typed_string,
'#size' => 30,
'#maxlength' => 100,
'#autocomplete_path' => 'taxonomy/autocomplete/5'. $vocabulary->vid,
'#required' => $vocabulary->required,
'#title' => $vocabulary->name,
'#description' => t('Enter the State or Province where you would like to find a representative").')
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Search'),
);
$output = drupal_get_form('find_a_lawyer', $form);
return $output;
}
function find_a_lawyer_submit($form_id, $form_values){
$arg1 = $form_values['?????????'];
drupal_goto("node/FindLawyer/$arg1");
}
any help appreciated, thanks.
-Chris