
DRUPAL module help
- or -
Post a project like this3949
$$
- Posted:
- Proposals: 4
- Remote
- #964674
- Awarded
Description
Experience Level: Intermediate
Hello
I have developed a custom module which is a 2 steps input form.
It works well and after step 2, it saves data in the database fine.
I need little help i.e
From step 2, when NEXT button is pressed, instead of saving data in the database it should display REVIEW page with the details/summary of forms contents in previous 2 steps.
REVIEW page should have 2 buttons i.e SUBMIT & CANCEL.
SUBMIT should save information in the database while CANCEL will send back to the step 1.
Please sent me a custom hourlie for this job.
Here is the link to the online version; http://www.webdevfreak.co.uk/drupal/multipageform/form1
and here is the code from the MODULE file...
###########
<?php
/**
* @file
* This is the main module file.
*/
/**
* Implements hook_help().
*/
function multipageform_help($path, $arg) {
if ($path == 'admin/help#multipageform') {
$output = '' . t('About') . '';
$output .= '' . t('The multipageform module shows how to create a multiple page form using Drupal.') . 'execute();
$form_state['redirect'] = array('confirm');
}
}
function getNumberOfSteps() {
return count(getForm());
}
function multipageform_form1_validate($form, $form_state) {
switch ($form_state['step']) {
case '0':
if(empty($form_state['values']['name']))
form_set_error('name','Name cannot be empty');
else if(empty($form_state['values']['last_name']))
form_set_error('last_name','Last name cannot be empty');
break;
case '1':
if(filter_var($form_state['values']['email'], FILTER_VALIDATE_EMAIL) == false)
form_set_error('email','Email is not valid');
break;
default:
break;
}
}
###########
I have developed a custom module which is a 2 steps input form.
It works well and after step 2, it saves data in the database fine.
I need little help i.e
From step 2, when NEXT button is pressed, instead of saving data in the database it should display REVIEW page with the details/summary of forms contents in previous 2 steps.
REVIEW page should have 2 buttons i.e SUBMIT & CANCEL.
SUBMIT should save information in the database while CANCEL will send back to the step 1.
Please sent me a custom hourlie for this job.
Here is the link to the online version; http://www.webdevfreak.co.uk/drupal/multipageform/form1
and here is the code from the MODULE file...
###########
<?php
/**
* @file
* This is the main module file.
*/
/**
* Implements hook_help().
*/
function multipageform_help($path, $arg) {
if ($path == 'admin/help#multipageform') {
$output = '' . t('About') . '';
$output .= '' . t('The multipageform module shows how to create a multiple page form using Drupal.') . 'execute();
$form_state['redirect'] = array('confirm');
}
}
function getNumberOfSteps() {
return count(getForm());
}
function multipageform_form1_validate($form, $form_state) {
switch ($form_state['step']) {
case '0':
if(empty($form_state['values']['name']))
form_set_error('name','Name cannot be empty');
else if(empty($form_state['values']['last_name']))
form_set_error('last_name','Last name cannot be empty');
break;
case '1':
if(filter_var($form_state['values']['email'], FILTER_VALIDATE_EMAIL) == false)
form_set_error('email','Email is not valid');
break;
default:
break;
}
}
###########
Baber A.
98% (50)Projects Completed
43
Freelancers worked with
28
Projects awarded
23%
Last project
28 Jan 2026
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies