You are here

function route_planner_address_form in Route Planner 6

Same name and namespace in other branches
  1. 7 route_planner.module \route_planner_address_form()

The Address-Form.

A form to input a address and get. The driving time and distance will automatically set after clicken the button.

Return value

The address form.

1 string reference to 'route_planner_address_form'
route_planner_get_address_form in ./route_planner.module
Get Address-Form Block

File

./route_planner.module, line 78
The Route Planner module create blocks to show a route from any address to a fixed point.

Code

function route_planner_address_form(&$form_state) {
  $form['start'] = array(
    '#type' => 'textfield',
    '#title' => t('Address'),
    '#default_value' => '',
    '#size' => 20,
  );
  $form['distance'] = array(
    '#type' => 'textfield',
    '#title' => t('Distance'),
    '#default_value' => '0.00',
    '#size' => 20,
    '#disabled' => TRUE,
  );
  $form['time'] = array(
    '#type' => 'textfield',
    '#title' => t('Driving time'),
    '#default_value' => '0.00',
    '#size' => 20,
    '#disabled' => TRUE,
  );
  $form['button'] = array(
    '#type' => 'button',
    '#value' => t('Calculate route'),
    '#attributes' => array(
      'onClick' => 'return Drupal.myRoutePlanner.calcRoute();',
    ),
  );
  return $form;
}