Forum
can't register additional form
I'm using perch on localhost. I tried to add a second form on the website, so I took an individual id for the new form, but it didn't register in the forms list (The form itself displays at the pages and in the browser). So I duplicated the running contact-form and changed the id to "test". But this also didn't register as a new form. The codeexample is from the running form which doesn't register Any Ideas? Thank You!
My diagnostics:
Perch: 3.1.2, PHP: 7.1.11, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (3.1.2), assets (3.1.2), categories (3.1.2), perch_forms (1.12)
App runtimes: <?php $apps_list = array( 'content', 'perch_forms' );
PERCH_LOGINPATH: /faly/perch
PERCH_PATH: C:\xampp\htdocs\faly\perch
PERCH_CORE: C:\xampp\htdocs\faly\perch\core
PERCH_RESFILEPATH: C:\xampp\htdocs\faly\perch\resources
Image manipulation: GD
PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: localhost
DOCUMENT_ROOT: C:/xampp/htdocs
REQUEST_URI: /faly/perch/core/settings/diagnostics/
SCRIPT_NAME: /faly/perch/core/settings/diagnostics/index.php
my template:
<perch:form id="test-form" method="post" app="perch_forms" autocomplete="on" role="form">
<div class="kontaktformular">
<perch:label for="name">Name</perch:label>
<perch:input type="text" id="name" placeholder="Max Musterfrau" required label="Name">
<perch:error for="name" type="required">Bitte geben Sie Ihren Namen ein</perch:error>
</div>
<div class="kontaktformular">
<perch:label for="email">E-Mail</perch:label>
<perch:input type="email" id="email" required label="E-Mail" placeholder="muster.name@genuss.at">
<perch:error for="email" type="required">Bitte geben Sie Ihre E-Mail-Adresse ein</perch:error>
<perch:error for="email" type="format">Bitte kontrollieren Sie Ihre E-Mail-Adresse</perch:error>
</div>
<div class="kontaktformular">
<perch:label for="tel">Telefonnummer für Rückfrage</perch:label>
<perch:input type="tel" id="tel" label="Telefon" placeholder="0123 123 45 67">
<perch:error for="tel">Bitte geben Sie Ihre Telefonnummer ein</perch:error>
</div>
<div class="kontaktformular">
<perch:label for="message">Nachricht</perch:label>
<perch:input type="textarea" id="message" required label="Message" placeholder="Ihre Nachricht an uns">
<perch:error for="message" type="required">Bitte geben Sie Ihre Nachricht ein</perch:error>
</div>
<div class="kontaktformular">
<perch:label for="checkbox" class="checkboxlabel">Ich bin mit der Speicherung<br>meiner Daten einverstanden</perch:label>
<perch:input type="checkbox" id="einverstanden" value="true" required aria-checked="false">
</div>
<div>
<perch:input type="submit" id="submit" value="Senden">
</div>
<perch:success>
<perch:content id="success" type="textarea" label="Thank you message" textile editor="markitup">
</perch:success>
</perch:form>
Hello Christoph,
Dashes
-
should be avoided forid
: https://docs.grabaperch.com/templates/attributes/id/You can instead use
contact_form
,test_form
etc.Thanks, I changed to underscores and also the wording. startet XAMPP amd pPerch new, but it doesn't registrate the form in the forms-list again.
Have you submitted the form at least once from the browser. This is the process which registers the new form in Perch.
You must submit it once for it to showup.
Yes it is submitted like all other pages. The Page with the form appears in the Browser, but the form does not work - I think because it isn't registered. I als tried to refresh the backend-page with the forms list, but there will only appear the first form.
Christoph,
The form will register the first time it is submitted from the browser.
If the form will not submit then it means there is a problem with the form coding.
Please submit your form template now that you have made changes, so we can check it for errors.
EDIT: Also you may need to turn on debug to find out where things are failing.
Debug at the bottom of the page in the Browser:
my form:
the debug at https://localhost/faly/perch/addons/apps/perch_forms/ where is only shown one form instad of two
In your form you are having an issue with the format... Why not remove the time field for now and see if things are working.
This error isn't showing up because you dont have a
perch:error
tag for the fieldtime
Thanks you are great. I conmmented out one part after the other. Now it works except if I try to use the time. Is it correct, that Perch does not work with <perch:input type="time">? I could not find this type in the specs. There is only "datetime" and "date". Do you know a workaround, because for picking the time it is not practicable.
You could always pass the time into the form unless you are needing the person filling the form to select a time... Otherwise you may need to come up with a better method then timestamping form submissions. I am thinking the datetime is already captured with each submission, so I am not sure what your asking of the form filler when it comes to time. A datetime field would already be populated with the current time and date upon submission.
It's a reservation-form for a coffehouse & bakery. That's why the customer has to pick the desired time. I didn't wanted to take a jQuery-Timepicker. Maybe I can try it with a text or numberfield.
or create a
select
field with time increments of 10-15 minutes. I have a few of these fields which have a real long list of select options which I do as template includes to keep from having a really long master template. Often I use template includes for things like...years
,makes
,colors
and such.