Individual Form Template has problem with saving data

Status
Not open for further replies.

Roland

Member
Hi,

I tried to create an individual form element which displays the required data of my table "buecher".
This part works pretty well.
On submitting the form (trying to save) it seems that nothing happens. I get back to the table view an my data are unchanged.

I guess it's a simple error in my template.
Nevertheless I define all data fields like {GROUP3_NACHNAME} in form.html, elements.html is required - otherwise I get the error message
"pat-Error Could not load templates from form/owv_buecher/elements.html."

Anyone who could have a brief view to my template?
Thank you.
 

Attachments

  • form.html
    3.3 KB · Views: 216
  • elements.html
    407 bytes · Views: 227
Hi Andre,

could you have a look at my problem with saving data on submitting the form on occasion?

Thank you,
Roland
 
What version are you using now? What version of web browser are you using? What operating system and PHP version? Mysql version?

You should put all that information into your signature for your forum profile.

Sadly I think only the Fabrik developers can download attachments, I keep getting a registration error when I try.

You probably should find your apache logs and look at those, since that will most likely show your PHP errors, and help you track it down quickly.

Andre
 
Hi Andre,

thanks for your response. I changed my signature and hope it contains the required information.
I think it is not a problem of my system environment but simply the form template that I built.
Saving with the standard template works.

I copied form.html, elements.html and template.css to a new template folder and assigned the form to it.
The display of the form works pretty well - alle variables including labels are shown in the form.
The saving button returns to the table view without saving and without error for one form.
Another form that I built the same way shows an error that indicates that there is no WHERE-Statement:

Fehler in der Syntax bei \'\' in Zeile 1. SQL=UPDATE gw_aufsaetze SET `afsautor`=\'Altrichter\',`afsvorname`=\'Helmut\',`afszwaut`=\'\',`afszwvor`=\'\',`afstitel`=\'\',`afsart`=\'A\',`afsepoch`=\'5\',`afsegdat`=\'2020-07-20\',`gutacht`=\'Ritter, Weis (3.4.1991)\',`afsdruck`=\'T\',`afsandat`=\'2007-07-02\',`afsbdnr`=\'256\',`afshftnr`=\'3\',`afsseit1`=\'661\' WHERE

I guess that there is a problem in the cooperation of form.html and element.html
In fact I don't call element.html but if I delete it I get the error:
pat-Error Could not load templates from form/owv_buecher/elements.html.

In the other templates if I understand it the code <mos:link src="elements" /> calls elemnt.html.
Now here is the code of my template-files.

form.html

<mos:comment>
@version 4.5.2
@package fabrik
@copyright (C) 2005 Rob Clayburn
@license http://www.gnu.org/copyleft/gpl.html GNU/GPL
</mos:comment>

<!-- <h1 class="componentheading">{FABRIK_TITLE}</h1>-->
<p class="fabrikintrotext">{FABRIK_INTRO}</p>
<div class="fabrikerror">{FABRIK_ERROR}</div>
<form action="{FABRIK_FORM_ACTION}" {FABRIK_FORM_JS} method="post" class="fabrikForm" name="{FABRIK_FORM_NAME}" id="{FABRIK_FORM_NAME}" enctype="{FABRIK_FORM_ENCTYPE}">

<h3>Bücher</h3>
<div class="mf_group" id="group3" style="">
<table cellpadding=2 cellspacing=0 border=0>

<tr class="mf_element">
<td>{GROUP3_LFDBUNR_LABEL}</td>
<td>{GROUP3_LFDBUNR}</td>
<td>{GROUP3_DATUM_LABEL}</td>
<td>{GROUP3_DATUM}</td>
<td>{GROUP3_HEFTNR_LABEL}</td>
<td>{GROUP3_HEFTNR}</td>
</tr>

... I removed the list of variables to shorten ...


<tr class="radio">
<td>{GROUP3_REZVORGANG_LABEL}</td>
<td>{GROUP3_REZVORGANG}</td>
<td>{GROUP3_LAUFZETTEL_LABEL}</td>
<td>{GROUP3_LAUFZETTEL}</td>

</table>
</div>


<mos:tmpl name="hidden-fields">
<input type="hidden" name="<mos:var name="name" />" value="{VALUE}" id="{ID}" />
</mos:tmpl>

<div class="fabrikActions">
<mos:var name="fabrik_rest_button" /><mos:var name="fabrik_submit_button" />
</div>
</form>

<mos:tmpl name="show-email" type="simplecondition" requiredvars="showEmail=1"> {EMAILLINK} </mos:tmpl>
<mos:tmpl name="show-pdf" type="simplecondition" requiredvars="showPDF=1"> {PDF} </mos:tmpl>
<mos:tmpl name="show-print" type="simplecondition" requiredvars="showPrint=1"> {PRINTLINK} </mos:tmpl>

<!--mos:var name="fabrik_templatevars" /-->

<mos:var name="fabrik_jsActions" />
<br style="clear:both;" />


element.html:

<mos:tmpl name="elements" addSystemVars="integer" >
<div class="mf_element" >
<mos:tmpl name="rows2" addSystemVars="integer" type="condition" conditionvar="doesnotmatter" >
<mos:sub condition="__first">
<!-- error message -->
<div class="fabrikerror">{ELEMENTS}</div>
</mos:sub>
<mos:sub condition="__default">
{ELEMENTS}
</mos:sub>
</mos:tmpl>
</div>
</mos:tmpl>


Thank you for help,
Roland
 
Re: Individual Form Template has problem with saving data (SOLVED)

I solved the problem:

1. The file form.html has to contain the Variable with the id of the table e.g. {GROUP3_ID}
2. In the backend I have to define the form by activating the checkbox "Record Form data in Database"

Roland
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top