Form doesn't save records on edit at custom template

Why inputs are not saved on editing my custom form template?

  • Maybe because of AJAX, the record that I want to join (which is not allowed to edit) affects it.

    Votes: 0 0.0%
  • In the template I'm using perhaps wrong methods to present the questions in the form

    Votes: 0 0.0%

  • Total voters
    0

marozen

Member
In my form I use calc and db_joins that use AJAX. At the custom form it seemed that all elements/questions should be echoed out and also not double. The database joins have AJAX, but I put the data_where on EDIT only, otherwise there will be an error on add new record.

On my new form template I'm able to add a new file, and to edit it also. But when I safe it I got this message: "You are not authorized to edit this record". And when I edit it again I see that previous inputs were not saved.

If I turn it back to the default bootstrap template I can add and edit the form without problem.
 

Attachments

  • Detail.png
    Detail.png
    216.2 KB · Views: 83
  • Form.png
    Form.png
    56 KB · Views: 72
Did you keep the structure in your custom template?
Especially did you keep the id element (primary key)?
 
In "<pre>"; print_r($this->groups); echo "</pre>" I can edit and and safe any record in my custom form template.

In the custom template I present all questions like this: $name = $elements['name']->element;
Also the id (hidden). And all of them work except for the databasejoin. When I exclude them the custom template works.

I don't know why it the databasejoins make problems: When I save the form the input is not saved.
 
Did you keep the structure in your custom template?
Especially did you keep the id element (primary key)?

Finally, I found the problem. You are right to keep the structure. I had all elements $name = $elements['name']->element; from the list.
And also everything echoed out. Except for $userid;

When I include the hidden $userid; I am able to safe the custom form correctly. So it's very important to call all elements and also to echo them in the custom form.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top