Page 1 of 1

FormBuilder not submitting

Posted: Mon Sep 12, 2016 8:14 am
by Robmichiels
Hello form members,

When im submitting the form from FormBuilder it does nothing but show me the browser information.

Code: Select all

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
I have been searching for hours what needs to be done for a form to do something but I couldn`t find anything, I suppose it has to send me email notifications of a submitted form?

CMSMS version: 2.1.5
FormBuilder version: 0.8.1.4
CMSMailer version: 6.2.14 (is working)

You can try to submit a form at:
www.k-slim.nl/contact-form

is there anyone who can help me out with this issue?

Re: FormBuilder not submitting

Posted: Tue Sep 13, 2016 4:01 pm
by calguy1000
Uhm... maybe you should make sure that your HTML validates as a first step.

Re: FormBuilder not submitting

Posted: Tue Sep 20, 2016 1:48 pm
by Robmichiels
I fixed the error but my form still doesn`t do anything

Re: FormBuilder not submitting

Posted: Tue Sep 20, 2016 3:21 pm
by Rolf
Robmichiels wrote:I fixed the error but my form still doesn`t do anything
Define doesn't do anything...

Re: FormBuilder not submitting

Posted: Wed Sep 21, 2016 4:54 am
by Robmichiels
Okay I am loosing my mind over a simple thing like building a form :-[

I needed to know how it works so I started building my own forms.
I`ve downloaded Skeleton module wchich passes variables to another php file.
Copied the part I needed but mine aint passing anything:

Original

Code: Select all

<?php
/**
 *
 * This is an example of a method to add
 * database data on page using a template.
 *
 * If the "skeleton_id" parameter is set, this page will
 * allow you to edit that record. Otherwise, it will let you
 * add a new record .
 *
 * Note that it uses a template, and is thus very powerful,
 * even if it's simple.
 */

/**
 * For separated methods, you'll always want to start with the following
 * line which check to make sure that method was called from the module
 * API, and that everything's safe to continue:
 */
if (!isset($gCms)) exit;

// don't trust that this was safe, just because the link is hidden if the option is off!
// always code defensively! There are beasties that lurk and things go bump in the night.
if (! $this->GetPreference('allow_add',1) == 1) exit;

/**
 * After this, the code is identical to the code that would otherwise be
 * wrapped in the action.
 */

// get our records from the database
$db = $gCms->GetDb();

if (isset($params['skeleton_id']))
   {
   $query = 'SELECT skeleton_id, description, explanation from '.cms_db_prefix().
      'module_skeleton where skeleton_id = ?';
   $result = $db->Execute($query,array($params['skeleton_id']));

   if ($result !== false)
      {
	  // load in the record if there was no error
      $row=$result->FetchRow();
      $sid = $row['skeleton_id']; // stupid -- we're passing the param, and then using the database version.
      $desc = $row['description'];
	  // we decode this next one, because it gets stored encoded, and the CreateTextArea API encodes as well, so
	  // if we didn't decode it, we'd get double encoding.
      $exp = html_entity_decode($row['explanation']); 
      }
   else
      {
      // yeah, that's graceful :(
      echo "Database error!";
      exit;
      }
   }
else
   {
   // if we didn't retrieve a record, set some default values
   $sid = -1;
   $desc = '';
   $exp = '';
   }

// set up form for Smarty
$smarty->assign('start_form', $this->CreateFormStart($id, 'save_record', $returnid));
// give Smarty translated field titles 
$smarty->assign('title_description',$this->Lang('title_description'));
$smarty->assign('title_explanation',$this->Lang('title_explanation'));
// create inputs for the Form elements, and pass them to Smarty. You'd best look up the crazy long parameter
// lists for the Form API in lib/classes/class.module.inc.php
$smarty->assign('input_description',$this->CreateInputText($id,'description',$desc));
$smarty->assign('input_explanation',$this->CreateTextArea(true, $id, $exp, 'explanation', '', '', '', '', 40, 5));
// pass a hidden key value along with the submit button
$smarty->assign('submit', /*$this->CreateInputHidden($id,'skeleton_id',$sid).*/$this->CreateInputSubmit($id, 'submit', $this->Lang('submit')));
$smarty->assign('end_form', $this->CreateFormEnd());


// Display the populated template
echo $this->ProcessTemplate('add_edit.tpl');

?>
And the tpl

Code: Select all

{$start_form}
<div class="form_row">
   <span class="field_title">{$title_description}</span>
   <span class="field_input">{$input_description}</span>
</div>
<div class="form_row">
   <span class="field_title">{$title_explanation}</span>
   <span class="field_input">{$input_explanation}</span>
</div>
<div class="form_row">
   <span class="field_title"></span>
   <span class="field_input">{$submit}</span>
</div>
{$end_form}
And its passing the variables in the URL
&mact=Skeleton,cntnt01,default,0&cntnt01returnid=2&cntnt01returnid=2&cntnt01description=q2e4rfqwe&cntnt01explanation=fqwefqwef&cntnt01module_message=Added%20record.


Now lets copy the part I need and it should do the same

Code: Select all

$smarty->assign('start_form', $this->CreateFormStart($id, 'save_record', $returnid));
// give Smarty translated field titles 
$smarty->assign('title_description',$this->Lang('title_description'));
$smarty->assign('title_explanation',$this->Lang('title_explanation'));
// create inputs for the Form elements, and pass them to Smarty. You'd best look up the crazy long parameter
// lists for the Form API in lib/classes/class.module.inc.php
$smarty->assign('input_description',$this->CreateInputText($id,'description',$desc));
$smarty->assign('input_explanation',$this->CreateTextArea(true, $id, $exp, 'explanation', '', '', '', '', 40, 5));
// pass a hidden key value along with the submit button
$smarty->assign('submit', /*$this->CreateInputHidden($id,'skeleton_id',$sid).*/$this->CreateInputSubmit($id, 'submit', $this->Lang('submit')));
$smarty->assign('end_form', $this->CreateFormEnd());
And the tpl

Code: Select all

{$start_form}
<div class="form_row">
   <span class="field_title">{$title_description}</span>
   <span class="field_input">{$input_description}</span>
</div>
<div class="form_row">
   <span class="field_title">{$title_explanation}</span>
   <span class="field_input">{$input_explanation}</span>
</div>
<div class="form_row">
   <span class="field_title"></span>
   <span class="field_input">{$submit}</span>
</div>
{$end_form}
But its not passing the variables in the URL
?mact=AutoReparatie,cntnt01,default,0&cntnt01returnid=1&cntnt01returnid=1&cntnt01module_message=Added%20record.
Difference
&mact=Skeleton,cntnt01,default,0&cntnt01returnid=2&cntnt01returnid=2&cntnt01description=q2e4rfqwe&cntnt01explanation=fqwefqwef&cntnt01module_message=Added%20record.

I have build several websites for my customers with CMSMS because I love to work with it but I have been trying to build a form now for 3 days.
I am really loosing my mind because I cant get a simple form to work.

What am I missing, probably something simple but I cannot figure out what?

Re: FormBuilder not submitting

Posted: Wed Sep 21, 2016 7:32 am
by Rolf
You didn't answer my question...

Re: FormBuilder not submitting

Posted: Wed Sep 21, 2016 12:19 pm
by Robmichiels
When I submit the form it gives a message that the form is send but the form data doesn't get send or stored

Re: FormBuilder not submitting

Posted: Thu Sep 22, 2016 8:00 am
by Rolf
Can be it ends up in the Spam box

Are you sure the mail is send in the first place?

You have to look at the form in the FB module admin where the mail is generated and check if all is filled in correctly. Check a default form.

Looking into the module files and Skeleton files is barking at the wrong tree...

grtz. Rolf

Re: FormBuilder not submitting

Posted: Wed Oct 05, 2016 3:17 pm
by mr.bacan
Hello Guys, I'm having the same issue since using the latest version of FormBuilder installed on CMSMS 1.12.1 or CMSMS 2.1.5 it doesn't matter what version. I've checked the spam folders but nothing there. I've also tried using mail, sendmail and smtp having the same ending.

I now started to save form content to a flat file and that works, so I guess the form is sending the info but no email is received anywhere.

It shouldn't be the server either, since I've tried using 2 completely different servers.

I have no idea what else to do. Any ideas?