Hello,
I've tried the multistep form guide (http://drupal.org/node/101707 and the various other posts on the subject but I'm still stuck, badly, on this.
I think it's down to $form_values not being passed back correctly.
What I'm trying to do:
1) create a form containing a list of questions (this is ok)
2) form submits & validates, a score is calculated dependent on answers (this is ok)
2a) A save button is shown to save this score.
This is where I get stuck. ** I've tried including a second form within the submit function and that doesn't work (it just gives me back the list of questions at step 1 upon submit.)
I've tried using a multistep form
A) If I use form_values then I get this problem of the form submitting after step 1 (and not going through the second case of the form. -> http://drupal.org/node/114378 Why is $form_values not set?
(http://drupal.org/node/101707)
B) I've even tried using the _POST[op] value rather than $step in the switch statement. This correctly steps through the form but the final submit doesn't work as it fails validation.
(ideally it would validate after step 1, and at step 2a seperately. Is this possible?)
Do I have to use a multistep form (if I can get it working?) or how can I get a second form to submit correctly? (as per ** above)
Hoping someone may be able to help..
Comments
I was trying to do something
I was trying to do something similar (output a second form from the submit step of a previous, multistep form) but couldn't find a way to do it - the submit function has to return a string for the redirect, it seems.
Is this drupal 4.7 or 5?
Is this drupal 4.7 or 5? In 4 I've had good luck using a button rather than a submit for every page except the last page. This causes the form callback to be called for each page. At the top of that function, you can keep track of the page number and and display the appropriate page's form array.
http://www.trailheadinteractive.com
--- Featured Projects ---
http://www.montanakitesports.com
http://www.cmrussell.org
http://www.tdandh.com
http://www.cccsmt.org
http://www.universalsemensales.com
http://www.trailheadinteractive.com
Hi, I'm using drupal 5.
Hi,
I'm using drupal 5. I'll see if I can replicate what you say above.
I've also tried hand coding a simple html form instead of drupal_get_form, I can then get it to submit and goto the save function but I can't seem to get hold of the form values.
Multipage forms
This form works....
Sorry for the huge code example I'm still trying to figure out how to upload my entire module somewhere to Drupal CVS.
Artificial Intelligence is no match against Natural Stupidity
This doesn't work. Still no
This doesn't work. Still no data passed to the form after the first submit :(
Has anyone found a solution to this?
please help me...
I m a new drupal user.
I want be create a multistep form.
But I don't know where do I write theese codes.
In node.module or another in the file.
Thank you.
Surfer_1
You'll want to create your
You'll want to create your own module. And I'd strongly recommend starting a new thread because this post is buried at the bottom of a long, old post.
http://www.trailheadinteractive.com
--- Featured Projects ---
http://www.montanakitesports.com
http://www.cmrussell.org
http://www.tdandh.com
http://www.cccsmt.org
http://www.universalsemensales.com
http://www.trailheadinteractive.com
how can i access this form
I copy and pasted this code to create a module, I have no idea how to access this form to see how it works once I enable the module lol
i tried type mydomain.com/testmod but get page 404 error