Re: FW: Webform Ajax - D7

Earnie Boyd <[email protected]>
Newsgroups gmane.comp.php.drupal.devel
Message-ID <[email protected]>
This is OT for this list.  This list is reserved for discussions of
Drupal core development.  Please move your query to [email protected]
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.