I am trying to create a custom form in drupal with a node field.
I would like to add some extra functionality to the autosave node. I created a view containing an argument. I would like to pass this argument from the drop down list as well as the typed text into an autocomplete script.
Does anyone know how I will start to do this.
/* FIELD 1 - the drop down */ $sql = "SELECT nid, title FROM node where type='resourcetype' AND status =1 order by title "; $result = db_query($sql); $counter = 0 ; $options = array(); while ($data = db_fetch_array($result)) { // krumo ($data); $options[$data[nid] ] = $data[title] ; if ($counter ==0 ) {$df = $data[nid]; } $counter ++; } /* FIELD 2 - the node reference field */ $form['sor']['type'] = array( '#type' => 'select', '#title' => t('Resource type'), '#required' =>TRUE, '#options' => $options, ) ; $form['sor']['field_asor_sors'] = array( '#type' => 'textfield', '#title' => t('Add a SOR item to this job'), '#autocomplete_path' => 'nodereference/autocomplete/field_asor_sors', '#element_validate' => array('myelement_validate_is_valid_noderef'), '#required' =>TRUE, );
Many thanks
Matt
source share