WebForm
more_horiz
close

on 18th November 2015 / by emily.mathew
To keep the default values of the step one form after successfully submitting the step 2 form, here is an easy way. Just pass the form state values of step 1 form as query parameters to the same page on submitting step 2 form. Set the default values of step 1 form as, first check whether the form_state value is set. If yes, set the default values of step 1 form fields with the form_state values. Else check the URL query parameters, whether this variable is set. If yes, then set the default value with that value. As the simple multi step form example tutorial in the examples module, if you have a field like first name in the step 1 form, then its default value could be set as follows. $parameters = drupal_get_query_parameters(); $form['first'] = array( '#type' => 'textfield', '#title' => t('First name'), '#description' => "Please enter your first name.", '#size' => 20, '#maxlength' => 20, '#required' => TRUE, ); if (isset($form_state['values']['first'])) { $form['first']['#default_value'] = $form_state['values']['first']; } elseif (isset($parameters['first'])) { $form['first']['#default_value'] = $parameters['first']; } In the submit function of the step two form, redirect the user to the current page by setting the form_state step 1 values as query parameters. $parameters = array(); if (!empty($form_state['page_values'][1])) { // Slice the $form_state['page_values'][1] array to get the form_state values of only the input fields of the step 1 form. $parameters = array_slice($form_state['page_values'][1], 0, 3); $path = current_path(); drupal_goto($path, array('query' => $parameters)); } The above code is really easy and will be helpful. Please feel free to get in touch with us if you have any queries regarding the same. Drupal WebForm Drupal Planet Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 24th August 2015 / by sarika.k
In one of my Drupal projects, I had a requirement to submit data from a webform to an external application. hook_webform_submission_insert() helps to meet my requirement. In your custom module, call the hook function hook_webform_submission_insert(). The below syntax will help you to implement and add your valuable code in each switch case. /** * Implement hook_webform_submission_insert(). * @param $node * The Webform node on which this submission was made. * @param $submission * The Webform submission data, that was just inserted into the database. */ function my_module_webform_submission_insert($node, $submission){ $webform_id = $node->nid; switch ($webform_id) { case CONTACTUS_NODE_ID: // Prepare data to be passed. // Call to submit your data. break; } }Now, if you have any queries or doubts, please feel free to post your comments or contact us. Drupal WebForm Drupal Planet Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 06th August 2015 / by sarika.k
I had a requirement to create webform in multiple environments. Webforms cannot be exported as features. Webform_share module helps to export the webform and then imported the same in my different work environment. The Webform_share module requires webform module. For installation, download and enable the webform_share module. Steps to export webform includes: After enabling this module export and import options are available to the webforms. Export and import are placed at the right of form settings on the page (node/[nid]/webform). Click export button to export the entire webform, a copy of the webform gets downloaded. Steps to import webform includes: Create new webform. Export and import are places at the right of form settings on page (node/[nid]/webform). Click import button to import the entire webform,which directs to the page (node/[nid]/webform/ws-import) Copy the entire code generated from a webform share export and paste it into the 'import code' textarea field. Click submit. The exported webform will be now available in the new environment. Note that, the existing webform components are completely replaced with the new webform components. If a component is removed or the key name is renamed, you can't access to any user submitted data. For more Drupal solutions details, check out our services and get in touch. WebForm Drupal 7 Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 06th August 2015 / by sarika.k
In one of my project, I have a requirement to show the form elements as a popup window on clicking a menu link. I have created the form using the Drupal webforms. I want to make this webform available as a popup window on click of the corresponding link. Drupal popup module helps to meet this requirement. Do you have a requirement like this, feel free to rush your need here. Required modules for Drupal popup are : Webform Popup Configuration : Create form to be appeared on popup using webform. From advanced options set this webform to be available as block by clicking the check-box. Go to blocks section Structure > Blocks and add the block to a region, save it . Configure the block. From visibility settings check the popup block . Check the check box to get the block available as popup form. Now your webform will be available as the popup form. Just create a menu for this to execute in your site. To clear your valuable doubts, click here. Share your suggestions with a hurry. Drupal 7 WebForm Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 05th August 2015 / by sarika.k
In my project I have a requirement to show the form elements as placeholders. Webform Hints module helps to meet my requirement. Webform Hints takes the title of a Webform component and uses it as the placeholder attribute. It works on following fields: textfield textarea select list (via #empty_option) Webform_hints requires webform modules. To configure the webform_hints go through these steps : Download and enable the webform_hints module Configuration > Content Authoring > Webform hints (admin/config/content/webform-hints) Select the webform where you want to apply webform_hints. Save configuration. For more details, connect with us. Hope you this tips help you. Feel free to clear, find and discuss drupal solutions along with us. WebForm Drupal 7 Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 04th August 2015 / by sarika.k
In my project I have a requirement to display the error message of webform submissions in a popup window. Webform is a module for creating simple or multi-step forms in Drupal in an easy way. To display the webform in popup is very hard to me. Webform Ajax module helps to meet this requirement. Its is very useful module for single or multi-step forms with pagination's in a popup box. Webform Ajax module adds AJAX support to Drupal Webform. The ajaxified webforms are very faster and better to use. For installing Webform Ajax module we need to first install Webform and Libraries modules. The following installation steps may help you to configure Webform Ajax in your drupal site : Download and enable the webform_ajax module Create or edit a webform node. Go to the tab webform. Select form settings, the URL will be : node/[nid]/webform/configure. AJAX will be available below the 'Advanced Settings' Section. Check "AJAX mode" Save Configuration. To clear your valuable doubts, feel free to type here. For more webform related tips or solutions, click here. WebForm Drupal 7 Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 03rd August 2015 / by deepak.r
While dealing with webforms we may need to integrate webform fields to external API or may need to save data to a custom table. In case of webform we don't need to add custom submit handler to deal with submitted data. You may also look into other solved issues and details related to Drupal webform over here. Webform hooks can be used to manage this. We can use 'hook_webform_submission_insert($node, $submission)' for the above mentioned context. There is a little difference in the array structure of webform from normal drupal forms, which may leads to certain confusions in processing submitted data. For webform field name is saved in the array $node and submissions values are saved $submissions mapped with array keys. We can easily get the 'field name' as 'keys' and 'form submission values' as 'array values' by doing the following. $components = $node->webform['components']; $data = $submission->data; $labels = array(); foreach ($components as $key => $component) { $labels[$key] = $component['form_key']; } $fields = array(); foreach ($data as $key => $values) { $fields[$labels[$key]] = $values['value'][0]; }Hope this saved your time. You can find more help with a wide range of Drupal services that we offer. Contact us to know more. Drupal 7 WebForm Leave a reply Your email address will not be published. Required fields are marker * Josh Valdivieso (not verified) access_time 23 May 2019 - 08:38 Great read, thanks for the info! KOMOKO Ltd (not verified) access_time 23 May 2019 - 08:38 Thanks for the info. Couple of things: In the latest version of webform (4.x) you don't need the ['value'], i.e. $values['value'][0]; should be $values[0]; Also you need to be careful selecting [0] as some fields may be multi-value arrays. You would be safe assigning like this: $fields[$labels[$key]] = $values; And the iterate through the $fields array to perform any logic. Add new comment
more_horiz
close

on 05th March 2015 / by deepa.n
Webform module is a perfect solution, if you are looking for a more complex contact form or multiple feedback forms to add to your Drupal 7 website. This module will enable you to create and manage as many forms as you need. Recently, we had a need to create three different feedback forms for a Drupal website. One of the webforms was a contact form to connect with different contact persons of the company where as, another one was to send enquiries about the products and there was a guest book page to leave feedback. Here is how we achieved all these requirements in one shot using the webform module. Steps for installing and configuring webform module Step 1: Download webform module Download webform module to your local machine (Download) Decompress the file Copy the module to your 'sites/all/modules' directory Step 2: Enable webform from modules Page Goto Administration » Modules Find the webform module Enable it by checking the box Save the changes Step 3: Create and configure webform Goto Administration » Add content Click on 'Webform' link Enter title and add a menu link Now, add 'form components' for your form Then click on 'E-mails' tab and set emails Finally make necessary form settings Save the changes Now, you can use this form by clicking the menu link from the main menu. By repeating the third step, we can create multiple forms for the site. Drupal Drupal 7 WebForm Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 31st May 2013 / by prasanna.tv
Webform is a Drupal module that can help webmasters create submission forms like survey forms, contest forms, contact us form etc without any custom programming. Usually webform submissions will result in the data being inserted as a new row into table 'webform_submitted_data'. But our client requirement was to update an existing submitted data from the table 'webform_submitted_data'. If you want to know how to update an existing webform submission then continue reading webform.submissions.inc (webform/includes/webform.submissions.inc) file has functions related to submitting new data, editing, or viewing data. Check out this file to see how webform handles these functionalities on a Drupal site. For updating the webform data you will have to pass the value of submission id from webform (sid). Set one field as primary key like emailid from the webform Alter the webform by using form alter hook Passing the value of submission id from webform (sid) to the variable " $form['details']['sid']['#value'] " .(Please see the example.) eg: <?php function modulename_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'webform_client_form_id') { $query = db_query("SELECT sid FROM webform_submitted_data where cid = 59 and data = 'data1'"); $result = db_fetch_array($query); $form['details']['sid']['#value']= $result['sid']; } } ?> Web Development Drupal PHP WebForm Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 27th December 2012 / by webmaster
A few Drupal users wanted to know how to increase the size of a selectbox in a Webform. If you are faced with the same question with a Webform in your Drupal site then read on to know the possible workarounds. Here are the possible solutions that should get you going on your way. The easiest solution is to use CSS in your theme to size the selectbox..webform-component-my-select select { height: 200px; } You could also try substituting the selectboxes with checkboxes or radio buttons as they are a better solution than mulitple select boxes Hope that helps. The easiest way to solve a Drupal issue is to hand it to the Drupal experts. We can provide a wide range of Drupal services to help you maintain and manage your Drupal websites. Get in touch with us to know more. Reference: http://drupal.org/node/1090828 Drupal Drupal 7 WebForm Drupal Issues Leave a reply Your email address will not be published. Required fields are marker *