[development] FW: Webform Ajax - D7

Idan Arbel idan at arbel-designs.com
Sun Jul 31 16:30:46 UTC 2011


ok. thanks. i appologize for the misuse of the list.
On Jul 31, 2011 7:28 PM, "Earnie Boyd" <earnie at users.sourceforge.net> wrote:
> This is OT for this list. This list is reserved for discussions of
> Drupal core development. Please move your query to support at drupal.org
> and see http://drupal.org/support and http://drupal.org/community for
> more options.
>
> Idan Arbel wrote:
>>
>>
>>
>>
>> Hello,
>>
>>
>>
>> I'm trying to get a webform to send the data via ajax on drpual 7.
>>
>>
>>
>> I've added this code into my template.php file. It seems to work well
except
>> for the fact that the data isn't saved at the end.
>>
>> What am I missing?
>>
>>
>>
>> function enjoon_form_alter(&$form, &$form_state, $form_id) {
>> if($form_id == 'webform_client_form_32'){
>> $form['actions']['submit'] = array(
>> '#type' => 'submit',
>> '#ajax' => array(
>> 'callback' => 'enjoon_ajax_callback',
>> 'wrapper' => str_replace('_','-',$form['#form_id']),
>> 'effect' => 'fade',
>> ),
>> '#value' => t('Submit'),
>> );
>> }
>> }
>>
>> function enjoon_ajax_callback($form, $form_state) {
>>
>> if(form_get_errors()){
>> return $form;
>> }
>> else{
>> return 'Thank you!';
>> }
>> }
>>
>>
>>
>>
>>
>> Thanks
>>
>>
>>
>> Idan
>>
>>
>
>
> --
> Earnie
> -- http://progw.com
> -- http://www.for-my-kids.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110731/02c7458b/attachment.html 


More information about the development mailing list