Forum
Few issues re: Forms
I've been able to create a Form using Perch Forms, and am embarking on a HTML email template, however now that I have created a /forms/email folder I am wondering why any .html templates do not appear in the /forms folder (logical).
So while templates in /content are in alphabetical order, folders are not so why is this the case?
Regarding my issues, it seems that the custom error messages I have made are not being shown in the browser.
In addition a supposed required field (enquiry) is being allowed through.
Here is my template:
<perch:form id="form-contact" method="post" action="/contacts/index.php" app="perch_forms" role="form">
<table id="ContactTable">
<caption>Contact Form</caption>
<thead>
<tr>
<td>Please enter your contact details and message.</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<perch:label for="name">Name</perch:label>
<perch:input id="name" type="text" required="true" label="Name" />
<perch:error for="name" type="required">Please type your name</perch:error>
</td>
</tr>
<tr>
<td>
<perch:label for="email">Email</perch:label>
<perch:input id="email" type="email" required="true" label="Email" placeholder="you@company.com" />
<perch:error for="email" type="required">Please add your email address</perch:error>
</td>
</tr>
<tr>
<td>
<perch:label for="enquiry">Enquiry</perch:label>
<perch:input id="enquiry" type="select" label="Enquiry" options="Select Enquiry Type..., General Enquiry, Request Information, Other" />
<perch:error for="enquiry" type="required">Specify enquiry type</perch:error>
</td>
</tr>
<tr>
<td>
<perch:label for="message">Message</perch:label>
<perch:input id="message" type="textarea" required="true" label="Message" />
<perch:error for="message" type="required">Please include a message</perch:error>
</td>
</tr>
<tr>
<td><perch:input type="submit" id="submit" value="Send" class="submit"/></td>
</tr>
</tbody>
</table>
<perch:success>
<p>Thank you</p>
</perch:success>
</perch:form>
Thanks for any help or assistance.
In addition, I cannot specify a template for HTML email even after a form has been submitted:
Can you show us your diagnostics report?
The required field looks fine - it has four options and there's no way for a user to not have one of those options selected.
Yes but if you leave the first option selected, it counts as not being required.
Is there any way to specify a default option without it being used as per a form submission?
A few lines relating to the host were removed.
You should be able to use the
placeholder
attribute for your default value.Hi Drew,
I put a
required="true"
attribute on the Perch input:and simply put a , as the first value.
It works but does not allow you to specify placeholder text.
Thanks again for pointing that out.
It doesn't work because the form does not validate with w3c.
How does it fail?