Domanda

I want to create a form in Drupal 7. User will select appropriate listbox, radio button options. When user clicks Submit button, form will post related values to another php file with GET arguments.

  • Default submit button shows a confirmation page for email sending/registration. I couldn't make the form to post arguments to a php file by changing submit behaviour of the form.

For two days I tried Webform module to do this. I would be happy if you can recommend me some way to make this? Examples, tryouts, modules, codes, etc

È stato utile?

Soluzione

There are 'better' ways but this will do the trick in a custom module:

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  $nid = 1; // Or whatever the node ID of your webform is
  if ($form_id == 'webform_client_form_' . $nid) {
    $form['#action'] = 'my-script.php';
    $form['#method'] = 'get';
  }
}

Bear in mind of course that the original webform submission functions will not run so your webform data won't be saved to the database.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top