Search

Is there a way to lets say, create a cuztomized registration form in the fronte end tha will send the info in the form to a section in the backend?

Ok so i created a section called "depoimentos" with the following fields:

text input : Nome text area : Depoimento

Then i created a event called depoimentos, wich gave me a form exemple to use, i inserted that form code in my page, and so far so good, but one thing i notice missing in the form is the action atribute.

When a submit the form in the front end i don´t get anything in the backend, and it´s got to be that action that is missing, what should i put there?

<input type="submit" value="submit" name="action[depoimentos]" />

edit: i'm sorry, i misunderstood you. you're talking about form action. the example form intentionally leaves this attribute empty, because the form submits on itself, so <form action=""> is correct.

could you possibly paste the entirety of your form?

additionally, one thing i find to be very helpful when debugging forms is create a simple textarea and fill it with all of the event feedback.

well i got to be doing something wrong, when a submit i get no errors and the page is redirect to the home page, but still nothing in the backend, i already atached the event to the page and all.

Is there anything else i have to do, besides: * creating the event,
* creating the page with the form,
* ataching the event to the page?

That´s my form code:

<form method="post" action="" enctype="multipart/form-data">
  <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />
  <label>Nome
    <input name="fields[nome]" type="text" />
  </label>
  <label>Depoimento
    <textarea name="fields[depoimento]" rows="15" cols="50"></textarea>
  </label>
  <input name="id" type="hidden" value="23" />
  <input name="action[depoimentos]" type="submit" value="Submit" />
</form>

You have an input with the name attribute set to id. That means you are trying to edit the entry with id 23. Remove the line

 <input name="id" type="hidden" value="23" />

and it (hopefully) should work.

That worked great. Now is there a way to restrict editing of that entry that was created by the form in the backend? like a read only entry?

well that prevents editing only on from front end input, no way to prevent from backend input?

Oh I see. No, probably not. You can hide the section from the navigation by un-ticking the checkbox in the section editor though.

I´m having trouble with this again, i created another event for a saction called contato, and form is as fallow:

<div id="contact_form">
<form method="post" action="" enctype="multipart/form-data">
  <div class="form_div">
  <label>Nome</label>
    <input class="input" name="fields[nome]" type="text" />
  </div>
  <div class="form_div">
  <label>Email</label>
    <input class="input" name="fields[email]" type="text" />
    </div>
  <div class="form_div">
  <label>Telefone</label>
    <input class="input" name="fields[telefone]" type="text" />
    </div>
  <div class="form_div">
  <label>Mensagem</label>
    <textarea class="textarea" name="fields[mensagem]" rows="15" cols="50"></textarea>
    </div>
  <div class="form_div">
  <input class="button" name="action[contato]" type="submit" value="" />
  </div>

</form>
</div>

But it just won´t send the data to the section, don´t know what is wrong with this.

I like to know how to get the errors after the form is submited, whats the best way to know what when worng?

Submit to the ?debug mode to see the XML result of the event:

<form method="post" action="?debug" ... >

well, i forgot to attach the event to the page, my fault.

Ah :-)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details