Forums

Multiple form with unlimited steps

michalmarianek 30 Jun, 2009
Hello
I'm new in chronoforms and it seems really great!!
In my project I need to have a multiple form but with unlimited steps. Each step would contain the same form.
I need it for screenplays forms. The form would be for one single scene and after each scene, user would eather submit form or add new scene (the same form again).
I know it's quite specific but can Chronoforms help with this issue?
If anybody solved this before, please help.
Thank you very much
Michal
Max_admin 30 Jun, 2009
Hi Michal,

nice idea, I will add it to the new release to be released in 2 hours!

Cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
michalmarianek 02 Jul, 2009
Great!!! This I call support! Thank you very much Max. Would you kindly direct me shortly on how to use that feature.
Thanks
Michal
Max_admin 02 Jul, 2009
Hi Michal,

Indeed I found that this issue can be solved another way, you may do a form and onSubmit check the posted value of the submit button, if its "add more" for example then you redirect them to the form again! example:

onsubmit after email code :

<?php
global $mainframe;
if(JRequest::getVar('formaction') == 'Add One More'){
$mainframe->redirect("form link goes here");
}
?>


form code:


<input name="formaction" type="submit" value="Add One More" />
<input name="formaction" type="submit" value="Finish" />


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
michalmarianek 03 Jul, 2009
Thank you very much Max.
For the sketch writers It is important that the all instances of the form (screenplay scenes) would be part of the whole form so they could see it all and edit changes.
Please take a look of this exaple:

This is the exaple of the form (one scene)

After "Add one more" you wil get the same instance of the form..

Over again untill you submit "Finish"


Is there a chance to manage something like this?
Thanks
Michal
nml375 03 Jul, 2009
Hi Michal,
This could be achieved with some creative javascripting, and some fancy backend code.
Did a quick google, and found this demo-page: http://www.randomsnippets.com/2008/02/21/how-to-dynamically-add-form-elements-via-javascript/. The code is pretty much straightforward, although it lacks the "remove form" button, and the php-code could use some further explanation.
You'll have to do some tweaking of the submitted data in order for chronoforms to do it's automated processing, such as email and/or db storage. Exactly how to do this would depend on how you intend the submitted data to be handled.

See if you can adopt this code for your form for starters, and we'll see about getting the submitted screenplay's where you want 'em further on.

/Fredrik
Max_admin 03 Jul, 2009
Hi Michal,

Oh, I didn't understand it this sway, if so then Fredrik's suggestion should work for you but as he said its a little complicated and its the only one I can find to have it just like your screenshot, you should pay attention that your fields names should be of type array with [] after the name and you should handle them properly on submit!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.