TOPIC:

Saving Information in DB on each MultiPage Step? 7 years 9 months ago #140339

  • pedro81's Avatar
  • pedro81
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 15273
  • Karma: 287
  • Thanks: 1077
Regarding the email we need a little workaround.

1. disable the standard email notification
2. create a hidden element called "finished"
3. change pedros code to:
function ff_savepage1_action(element, action)
{
    switch (action) {
        case 'click':

JQuery.ajax({
          type: "POST",
          url: JQuery(element).closest("form").attr("action"),
          data: JQuery(element).closest("form").serialize(),
          success: function(data)
          {
            ff_getElementByName('finished').value=0;
          }
        });

            break;
        default:;
    } // switch
}

4. go to Form properties->advanced->more options->Scripts->initscript->custom and check "create code framework"

between the curly brackets { } put this:

ff_getElementByName('finished').value=1;


5. go to Form properties->advanced->more options->submit pieces->custom and put the following code into the box:

$this->execPieceByName('ff_InitLib');
$finished = ff_getSubmit('finished');
$fromname = 'Your from Name'; //  /* Change to desired from name */
$recipient = 'your@email.com'; /* Change to Your Admin Email Address */

 
// Create the Body format for use in e-mail
foreach ($this->maildata as $data)
{
     if ($data[_FF_DATA_TYPE] != 'Hidden Input')
     {
          $body .= $data[_FF_DATA_TITLE].":
          ".$data[_FF_DATA_VALUE].nl();
     }
}

if($finished==1){ 
$this->sendMail($from, $fromname, $recipient, $body); // This line actually emails the form.

}

6. Now save everything and tet the form, it should work!

I hope this helps.

Please Log in or Create an account to join the conversation.

Saving Information in DB on each MultiPage Step? 7 years 9 months ago #140612

  • amrish16
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
Hello,

Thanks for your help.

i have tried same things but when i trying to save form then its giving me error like "connection problem, trying again in 7 seconds, please wait..." and its just doing same thing again and again.

and i remove that code and just save form then it will save successfully.

i have write below code, plz check it for me.

function ff_save_action(element, action)
{
switch (action) {
case 'click':
document.cookie="send_email=1";
jQuery.ajax({
type: "POST",
url: jQuery(element).closest("form").attr("action"),
data: jQuery(element).closest("form").serialize(),
success: function(data)
{
alert('Saved data'); // possible pop-up confirmation
}
});
break;
default:;
} // switch
} // ff_save_action

please let me know what i am missing

Please Log in or Create an account to join the conversation.

Saving Information in DB on each MultiPage Step? 7 years 9 months ago #140783

  • pedro81's Avatar
  • pedro81
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 15273
  • Karma: 287
  • Thanks: 1077
That time out issue is because your PHP configuration.

Could you please check the PHP_error_log file of your server? it could have helpful info about that problem.

Please Log in or Create an account to join the conversation.

Saving Information in DB on each MultiPage Step? 7 years 8 months ago #143029

  • irosas
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 20
  • Thanks: 0
Hi Pedro,

I'm on the same boat as many people in the forum, that is, wanting to save each page of a multipage form for later completion. I have tried both solutions on this thread, namely, adding ff_submitForm(); to a custom submit button and now the more complex solution you provide. In both cases the added custom button did nothing. However, in your more complex solution, I have a couple of questions:

1. at which point in the page is the hidden element named "finished" added? before or after the custom submit button?
2. which of the submit pieces is the one that gets the PHP code you wrote?
3. Do I need to change anything in my PHP.ini file for sendMail to work?
4. Can you think of any other reason why your solution didn't work for me? It seems like a very complete solution...

Thanks!

Please Log in or Create an account to join the conversation.

Saving Information in DB on each MultiPage Step? 7 years 8 months ago #143031

  • irosas
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 20
  • Thanks: 0
Pedro,

One other thing, do I have to do anything special with the hidden element named "finished" other than adding it to the form. That is, are no custom scripts required for that element?

Please Log in or Create an account to join the conversation.

Saving Information in DB on each MultiPage Step? 7 years 8 months ago #143064

  • irosas
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 20
  • Thanks: 0
Hi Pedro,

I thought of a reason why maybe your code isn't working for me... Could it be because I am running my site in Localhost? Would it work if I go to a host?

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.055 seconds

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!