[development] Drupal 6, Webform submit query

Prajwala Manchikatla prajwala.manchikatla at azri.biz
Mon Oct 10 09:43:29 UTC 2011


Hi Rohit,

This is a support request, so it should go to support mailing list.
You can write your custom submit handler by using hook_form_alter.

function MODULE_form_alter(&$form, &$form_state, $form_id)  {
  if ($form_id == 'webform_client_form_4') {
    $form['#submit'][] = 'custom_form_submit_handler_function'; // Note that
this function will be called after the default webform submit handler
  }
}

function custom_form_submit_handler_function($form, &$form_state) {
  // write your custom code
}

Regards,

On Mon, Oct 10, 2011 at 1:50 PM, Rohit Sharma <imreckless at gmail.com> wrote:

> Hi,
> Here is a snippet of a webform i created through Webform Module. Drupal 6.
>
>
> All i want is my custom code to be executed on submit. But no documentation is precise.
>
> <form action="/RWPS/?q=node/4"  accept-charset="UTF-8" method="post" id="webform-client-form-4" class="webform-client-form" enctype="multipart/form-data">
> <div><div class="webform-component webform-component-textfield" id="webform-component-md5"><div class="form-item" id="edit-submitted-md5-wrapper">
>  <label for="edit-submitted-md5">MD5: </label>
>  <input type="text" maxlength="128" name="submitted[md5]" id="edit-submitted-md5" size="32" value="" class="form-text" />
> </div>
> </div><div class="webform-component webform-component-textfield" id="webform-component-sha256"><div class="form-item" id="edit-submitted-sha256-wrapper">
>  <label for="edit-submitted-sha256">SHA256: </label>
>
>  <input type="text" maxlength="64" name="submitted[sha256]" id="edit-submitted-sha256" size="64" value="" class="form-text" />
> </div>
> </div><input type="hidden" name="details[sid]" id="edit-details-sid" value=""  />
> <input type="hidden" name="details[page_num]" id="edit-details-page-num" value="1"  />
> <input type="hidden" name="details[page_count]" id="edit-details-page-count" value="1"  />
> <input type="hidden" name="details[finished]" id="edit-details-finished" value="0"  />
> <input type="hidden" name="form_build_id" id="form-96640775ae006eafa3df3b980bdd2ead" value="form-96640775ae006eafa3df3b980bdd2ead"  />
> <input type="hidden" name="form_token" id="edit-webform-client-form-4-form-token" value="c2c0540261fb185ef87e38acd8cb2b1c"  />
> <input type="hidden" name="form_id" id="edit-webform-client-form-4" value="webform_client_form_4"  />
> <div id="edit-actions" class="form-actions form-wrapper"><input type="submit" name="op" id="edit-submit" value="Submit"  class="form-submit" />
> </div>
> </div></form>
>
> form Id is : webform_client_form_4
>
> Is there a way to write my own submit code , can anyone give me a precise
> method that works.
>
> I want to display a message when form submits to test that hook is called
> or not ? I tried webform_submit()
>
> in my case i wrote webform_webform_client_form_4_submit() hooks, does not
> work.
>
> --
> Thanks and regards,
> Rohit Sharma
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20111010/35d3f5f3/attachment-0001.html 


More information about the development mailing list