<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">Hi Rohit,<div><br></div><div>This is a support request, so it should go to support mailing list. </div>
<div>You can write your custom submit handler by using hook_form_alter. </div><div><br></div><div>function MODULE_form_alter(&$form, &$form_state, $form_id) {</div><div> if ($form_id == '<span style="font-family: monospace; white-space: pre-wrap; ">webform_client_form_4</span>') {</div>
<div> $form['#submit'][] = 'custom_form_submit_handler_function'; // Note that this function will be called after the default webform submit handler</div><div> }</div><div>}</div><div><br></div><div>function custom_form_submit_handler_function($form, &$form_state) {</div>
<div> // write your custom code</div><div>}<br><br>Regards,</div></span><br><div class="gmail_quote">On Mon, Oct 10, 2011 at 1:50 PM, Rohit Sharma <span dir="ltr"><<a href="mailto:imreckless@gmail.com">imreckless@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><pre><span style="font-family:tahoma,sans-serif">Hi, </span><br style="font-family:tahoma,sans-serif"><span style="font-family:tahoma,sans-serif">Here is a snippet of a webform i created through Webform Module. Drupal 6.</span><br style="font-family:tahoma,sans-serif">
<span style="font-family:tahoma,sans-serif">All i want is my custom code to be executed on submit. But no documentation is precise</span>.<br style="font-family:arial,helvetica,sans-serif"><br><<span>form</span><span> action</span>=<span>"/RWPS/?q=node/4" </span><span>accept-charset</span>=<span>"UTF-8" </span><span>method</span>=<span>"post" </span><span>id</span>=<span>"webform-client-form-4" </span><span>class</span>=<span>"webform-client-form" </span><span>enctype</span>=<span>"multipart/form-data"</span>>
<<span>div</span>><<span>div</span><span> class</span>=<span>"webform-component webform-component-textfield" </span><span>id</span>=<span>"webform-component-md5"</span>><<span>div</span><span> class</span>=<span>"form-item" </span><span>id</span>=<span>"edit-submitted-md5-wrapper"</span>>
<<span>label</span><span> for</span>=<span>"edit-submitted-md5"</span>>MD5: </<span>label</span>>
<<span>input</span><span> type</span>=<span>"text" </span><span>maxlength</span>=<span>"128" </span><span>name</span>=<span>"submitted[md5]" </span><span>id</span>=<span>"edit-submitted-md5" </span><span>size</span>=<span>"32" </span><span>value</span>=<span>"" </span><span>class</span>=<span>"form-text" </span><span><span>/</span></span>>
</<span>div</span>>
</<span>div</span>><<span>div</span><span> class</span>=<span>"webform-component webform-component-textfield" </span><span>id</span>=<span>"webform-component-sha256"</span>><<span>div</span><span> class</span>=<span>"form-item" </span><span>id</span>=<span>"edit-submitted-sha256-wrapper"</span>>
<<span>label</span><span> for</span>=<span>"edit-submitted-sha256"</span>>SHA256: </<span>label</span>>
</pre><pre> <<span>input</span><span> type</span>=<span>"text" </span><span>maxlength</span>=<span>"64" </span><span>name</span>=<span>"submitted[sha256]" </span><span>id</span>=<span>"edit-submitted-sha256" </span><span>size</span>=<span>"64" </span><span>value</span>=<span>"" </span><span>class</span>=<span>"form-text" </span><span><span>/</span></span>>
</<span>div</span>>
</<span>div</span>><<span>input</span><span> type</span>=<span>"hidden" </span><span>name</span>=<span>"details[sid]" </span><span>id</span>=<span>"edit-details-sid" </span><span>value</span>=<span>"" </span><span><span>/</span></span>>
<<span>input</span><span> type</span>=<span>"hidden" </span><span>name</span>=<span>"details[page_num]" </span><span>id</span>=<span>"edit-details-page-num" </span><span>value</span>=<span>"1" </span><span><span>/</span></span>>
<<span>input</span><span> type</span>=<span>"hidden" </span><span>name</span>=<span>"details[page_count]" </span><span>id</span>=<span>"edit-details-page-count" </span><span>value</span>=<span>"1" </span><span><span>/</span></span>>
<<span>input</span><span> type</span>=<span>"hidden" </span><span>name</span>=<span>"details[finished]" </span><span>id</span>=<span>"edit-details-finished" </span><span>value</span>=<span>"0" </span><span><span>/</span></span>>
<<span>input</span><span> type</span>=<span>"hidden" </span><span>name</span>=<span>"form_build_id" </span><span>id</span>=<span>"form-96640775ae006eafa3df3b980bdd2ead" </span><span>value</span>=<span>"form-96640775ae006eafa3df3b980bdd2ead" </span><span><span>/</span></span>>
<<span>input</span><span> type</span>=<span>"hidden" </span><span>name</span>=<span>"form_token" </span><span>id</span>=<span>"edit-webform-client-form-4-form-token" </span><span>value</span>=<span>"c2c0540261fb185ef87e38acd8cb2b1c" </span><span><span>/</span></span>>
<<span>input</span><span> type</span>=<span>"hidden" </span><span>name</span>=<span>"form_id" </span><span>id</span>=<span>"edit-webform-client-form-4" </span><span>value</span>=<span>"webform_client_form_4" </span><span><span>/</span></span>>
<<span>div</span><span> id</span>=<span>"edit-actions" </span><span>class</span>=<span>"form-actions form-wrapper"</span>><<span>input</span><span> type</span>=<span>"submit" </span><span>name</span>=<span>"op" </span><span>id</span>=<span>"edit-submit" </span><span>value</span>=<span>"Submit" </span><span>class</span>=<span>"form-submit" </span><span><span>/</span></span>>
</<span>div</span>>
</<span>div</span>></<span>form</span>></pre>form Id is : webform_client_form_4<br><br>Is there a way to write my own submit code , can anyone give me a precise method that works. <br>
<br>I want to display a message when form submits to test that hook is called or not ? I tried webform_submit()<br><br>in my case i wrote webform_webform_client_form_4_submit() hooks, does not work.<br clear="all"><font color="#888888"><br>
-- <br>
Thanks and regards,<br>Rohit Sharma<br><br><br>
</font></blockquote></div><br>