Closed (fixed)
Project:
Multi-step forms
Version:
7.x-1.0-beta4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2012 at 04:48 UTC
Updated:
28 May 2012 at 16:20 UTC
Hi,
I added the following code into mforms_example/mforms/mforms_example.session_store_example.inc:
function _mforms_example_step1_validate($form, &$form_state) {
if (!$form_state['values']['www']) {
// form_set_error wont prevent the step 1 form going to the step 2 form.
form_set_error('www', t('Website is missing...'));
// Just to make sure this portion of code was reached when the ajax callback ran, I also added a drupal_set_message.
drupal_set_message('Yes, this portion of the code has been visited, so the validation callback is being called properly.');
}
}
So, in my mind the step 1 form at YOURDOMAIN/mforms/example/session should persist when the "Continue" button is hit and "Your web site" field is left empty. That doesn't happen, the step 2 form gets loaded instead.
Is it a bug or am I missing something?
Comments
Comment #1
blueminds commentedHi FranciscoLuz,
I suppose you used MformsMultiStepControls as form controls. If that is the case limit_validation_errors has been implied on continue button, which prevented the validation. The problem is now fixed, the new release including the fix will be out soon.
Thanks for your feedback.
Comment #2
FranciscoLuz commentedHi,
I just read the doc at http://api.drupal.org/api/drupal/includes%21form.inc/function/form_set_e... after looking into your latest commit and now I see why it wasn't working.
Thank you,
Comment #3.0
(not verified) commentedminor grammar correction.