I just ran into this tutorial on how to convert any form into a wizard form. Wouldn't this be a cool feature for gravity forms as an optional output of the form??
I just ran into this tutorial on how to convert any form into a wizard form. Wouldn't this be a cool feature for gravity forms as an optional output of the form??
That looks pretty cool.
It will be great if they add this future.
+1 on wanting wizard forms.
We have looked into this and it is something we plan on adding in the future. We will first need to implement Fieldset capabilities and then this wizard plugin would be usable.
+1 on this option
Carl, do you have a timetable for when Fieldset capabilities will be implemented?
For those interested, I've got a bit of jQuery that will break the form down into sections/fieldsets which theoretically would make it usable with the wizard plugin mentioned earlier in this post.
In order for the script to work you'll need to:
<div class="add-gf-sections">[form shortcode]</div>
The script checks if the form is inside the 'add-gf-sections' div, and if so, adds everything into sections based on fieldsets. There are some known limitations that weren't an issue for me but might be for you:
Hope the helps.
If you don't want to use the section breaks you can always use the jQuery .slice() method..
I would love to try and implement this onto a site I am working on but I'm a little unclear of exactly how I need to do it. I understand what is required to get it to work but not clear how I get jquery on my page?? I'm a little bit of a newbie when it comes to these kinds of customizations so any step by step of how to accomplish this multiple page form based on sections would be greatly appreciated. Thanks!
You need to make sure the jQuery library is called in your theme. It should be called from the header.php file
Here's a good resource on including jQuery in WordPress.
http://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/
thanks Kevin... I will take a look!
Well I thought I did everything correctly but I'm not getting it to work. In fact, my form has disappeared :(
I followed the steps and placed code in the header file of my theme as instructed and created a .js file with the code from http://pastie.org/997000 inside and then added the <div> tag to surround my shortcode and it doesn't work.
The .js file I used I simply uploaded to the media folder within WP and didn't think that was a problem but I'm not sure. The URL where the form is currently being worked on is here:
http://thewebmonsters.com/hospital/career-opportunities/apply-now/
Again any help getting this worked out would be great. I have a number of sections in this form and it would be great to break it up into those sections as this post is suggesting. Thanks!
Hmmm, I am trying to do this, but can't work it out.
I have the following in my template head:
http://www.pastie.org/1026799
Plus including jquery.
I'm not sure what the instruction above "wrap your form shortcode like so" means, orhow to do it.
Also do I have to add some jqeury code that will trigger the form to be made into a wizard on page load? Or does the wizard plugin already do it onload? The example makes you click the link to convert to wizard form, not sure if we need to do anything.
Any help would be appreciated.
I'm brand new to GV as of today, and really would love a wizard style form.
Thanks
Think I understand the "wrap your form shortcode like so" now.
To the page that displays the gravity form, I wrapped the:
[gravityform id=1 name=Test Form]
And made it:
<div class="add-gf-sections">
[gravityform id=1 name=Test Form]
</div>
Also, I have added:
jQuery('#gform_1').formToWizard();
^ is that right?
To the very bottom of the <script></script> tag in the http://www.pastie.org/1026799
Using Firebug I can see Fieldsets being added:
<fieldset class="gsection-container">
But no <legend></legend> tags like the http://www.jankoatwarpspeed.com/post/2009/09/28/webform-wizard-jquery.aspx site suggests.
Also despite these fieldsets being added, nothing else is noticeably happening.
I'm totally lost with this :)
Please help. 2am here. :) Thx
Maybe the problem is the jquery plgin code uses $ (eg. http://www.pastie.org/1026848 - $.fn.formToWizard etc) whereas my jquery install for some reason uses jQuery notation (eg. jQuery(document).ready( ..... ) ).
Not sure, could this be a problem?
Getting the following error with the code I mentioned above. "Error: uncaught exception: Syntax error, unrecognized expression: #" No idea what is triggering it.
Ok, I got it to work, but not sure why I had to do it this way.
Anyway, the notation mentioned in the FormTOWizard plugin tutorial:
$("#SignupForm").formToWizard();
or rather
jQuery("#SignupForm").formToWizard(); //What I needed
Doesn't work.
After 4 hours sleep, and lots of headbanging I worked out the alternative notation worked:
$("#SignupForm").formToWizard({ submitButton: 'SaveAccount' });
or
jQuery("#SignupForm").formToWizard({ submitButton: 'SaveAccount' }); //What I needed
I am not sure why the earlier mentioned version causes the "Syntax error, unrecognized expression: #" error. I even copied and pasted the form as per the tutorial example into my plainpage template and the earlier call method still caused the same error.
Not sure exactly what the { submitButton: 'SaveAccount' } achieves, didn't understand the plugin's explanation of it.
HOWEVER, to get this to work, I had to add the following line of code:
jQuery('.button').attr("id", 'SaveAccount');
Which finds any button and adds the ID.
A better way would be to add the ID element to the Submit Button is gravity Forms, but that is over my head. I'm only a 15hr baby user of Gravity Forms :) If this (assigning an ID to the Submit element) is achievable within Gravity forms, please let me know how. :)
LASTLY, It still isn't very pretty without having <legend></legend> tags.
Without <legend> it outputs "Step 1null" etc.
Is there anyway of modifying the jQuery code:
http://www.pastie.org/1027561
To somehow dynamically add a <legend></legend> tag, based on the value of the next
Thanks
Ok, after some play, and modification I got it to add legend tag based on section titles.
Here is the code:
http://www.pastie.org/1027582
Please remember I'm a gravity forms infant, and well just hack my way through jQuery, so if there is any better way of achieving this I would love to know. Thanks!
Also, still, if there is anyway of adding an ID element to the submit button within gravity forms, without needing my jQuery hack, I would still love to know. Thanks.
ps. Sorry if I posted in here too much :) Just hope somebody finds it useful.
Hmmm, this breaks the gravity Forms form validation. Anyone worked out a solution to that?
(*feel like I'm talking to myself here*) :)
Hi Idealists, could you provide a link to the form you are working with?
Hi David, it is on local host at the moment. I will try and get it to a test "live" site soon.
Have you got this working yourself, with Gravity Forms' form validation etc?
ps. Anyway of posting a link to you, without posting it in the forum, want to keep it private.
You could contact David directly:
http://forum.gravityhelp.com/topic/need-help#post-5993
Thanks, David you've got mail, with link.
Kind regards.
Ok, I have fixed the problem.
The original jQuery code that did the conversion was deleting the line:
<input type='hidden' class='gform_hidden' name='is_submit_1' value='1'>
..which seems to be required for the form to process.
So I simply added the following line:
sections_html = "<input type='hidden' class='gform_hidden' name='is_submit_1' value='1'>" + sections_html;
See here for the full code:
http://www.pastie.org/1033669
Hope that helps somebody else.
Have updated the fix.
As I only have 1 form, i didn't realise my fix wouldn't work unless the form # is 1.
So this fix should work no matter what the form # is.
See:
http://www.pastie.org/1033740
Also, it would seem, you can not have more than 1 gravity form per page to use wizard forms.
If anyone can fix that, please let me know.
Thanks.
Made a slight modification (adding form_number) to make sure forms work where form number is not 1:
http://www.pastie.org/1033740 (modified previous pastie with fix)
Quick fix, sure it could be done neater.
This works for me, except if there is validation error, it will break back to a normal form.
Does this 'work around' validate fields when submitting the form for step 2?
Ok,
So if we put this into a concise outline is this what we have:
1. Create form with multiple sections
2. Insert form into post/page with form wrapped in div class="add-gf-sections" like so:
<div class="add-gf-sections">[gravityform id=1 name=Test Form]</div>
3. Insert code from http://www.pastie.org/1033740 into head of page - before the <body>
4.ensure you have jquery called in the head of the site
5. Should work...
Am I missing a step? The entire form is now "invisible".
Here is the page I have currently in progress:
http://www.gopeople.org/inquire/
(form is there - wizard jquery is hiding the entirety of it though...
Is there additional work needed in the form creation.
Tips or pointers would be awesome.
Tim, Gravity Forms 1.5 now adds built-in multipage form support. You can download the beta version from the downloads page and give it a try.
http://www.rocketgenius.com/gravity-forms-1-5-multi-page-form-preview/
Kevin,
Looking awesome!
Testing and almost ready to use this live.
Question - the progress bar:
In my mind this should start at 0% and progress should be displayed after the first part is complete.
I.E. note the page mentioned.
5 part form - 20% complete shown at the next step?
Also wondering if there is anything here I can configure - such as showing the progress at the bottom instead of the top. Perhaps there is a forum post on this already?
Good stuff!
Tim
Theres no option to put the progressbar at the bottom. The only options are selecting the style, displaying the alternate steps or not displaying anything.
We originally tried starting the bar at 0 on the first page but in tests, it proved more confusing to people when the last step (confirmation) never got to 100%.
You can always add an HTML block to the end of each page and recreate the progressbar manually. Copy the markup, set the percentage (defined by inline style) to your preference and you're good to go.
<div class="gf_progressbar_wrapper" id="gf_progressbar_wrapper_4">
<h3 class="gf_progressbar_title">Step 1 of 5 - Contact Information</h3>
<div class="gf_progressbar">
<div style="width: 20%;" class="gf_progressbar_percentage percentbar_orange"><span>20%</span></div>
</div>
</div>