Forum
Perch Form Not Submitting
Hi there,
I have created some forms for a site that takes bookings, and created this form template:
<h1><perch:content id="title" type="text" label="Form Title" required="true" /></h1>
<div class="hidden" id="service_dates_data" style="display: none;">
<perch:repeater id="dates" type="textarea" label="On site service dates">
<div class="date_single">
<perch:content type="date" id="service_dates_input" format="jS F Y" />
</div>
</perch:repeater>
</div>
<perch:form id="clientbooking" method="post" app="perch_forms" class="client-form">
<perch:content id="intro" type="textarea" label="Booking form introduction" html="true" editor="redactor" size="m" />
<div class="form-row">
<perch:label for="fname">First name</perch:label>
<perch:input type="text" id="fname" required="true" label="First name" />
<perch:error for="fname" type="required">Please add your first name</perch:error>
</div>
<div class="form-row">
<perch:label for="lname">Last name</perch:label>
<perch:input type="text" id="lname" required="true" label="Last name" />
<perch:error for="lname" type="required">Please add your last name</perch:error>
</div>
<div class="form-row">
<perch:label for="email">Email</perch:label>
<perch:input type="email" id="email" required="true" label="Email" placeholder="" />
<perch:error for="email" type="required">Please add your email address</perch:error>
<perch:error for="email" type="format">Please check your email address</perch:error>
</div>
<div class="form-row">
<perch:label for="mobile">Mobile number</perch:label>
<perch:input type="text" id="mobile" required="true" label="Mobile" placeholder="" />
<perch:error for="mobile" type="required">Please add your mobile telephone number</perch:error>
</div>
<div class="form-row">
<perch:label for="landline">Landline number</perch:label>
<perch:input type="text" id="landline" label="Landline" placeholder="" />
</div>
<div class="form-row">
<perch:label for="servicedate">Service Date</perch:label>
<perch:input id="servicedate" type="select" label="Service Date" options="Test|test,Test 2|test2" allowempty="false" required="true" />
<perch:error for="servicedate" type="required">Please select a service date</perch:error>
</div>
<div class="form-row">
<perch:label for="service">Service Required</perch:label>
<perch:input type="radio" id="service" options="Regular Service (£65)|Regular,Tune Up Service (£45)|Tune up,MOT (Free)|MOT" wrap="span.radiowrapper" required="true" />
</div>
<div class="form-row">
<perch:label for="message">Comments/Notes</perch:label>
<perch:input type="textarea" id="message" label="Message" />
</div>
<div class="form-row">
<perch:input type="submit" id="submitonsite" value="Book a Service" />
</div>
<perch:success>
<perch:content id="success" type="textarea" label="Booking confirmation message" html="true" editor="redactor" />
</perch:success>
</perch:form>
However the form will not submit, it just reloads the page. I've tried everything I can think of to make the form sbumit to the forms app (standard install, most recent version) and have had no luck.
Other forms on the site work fine - the page that the form is on actually has another form that works fine on the same page - but this form will not submit.
So basically, what can I try or have I made a silly mistake in the form template (e.g. are repeaters allowed?)
Thanks,
Matt
Diagnostic Report:
SUMMARY INFORMATION
Perch: 2.8.6, PHP: 5.4.10, MySQL: 5.0.77, with PDO Server OS: Linux, apache2handler Installed apps: content (2.8.6), assets (2.8.6), categories (2.8.6), perch_blog (4.6), perch_forms (1.8.3) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', ); PERCH_LOGINPATH: /admin PERCH_PATH: /mnt/stor2-wc1-dfw1/400029/423944/havebike.review-now.net/web/content/admin PERCH_CORE: /mnt/stor2-wc1-dfw1/400029/423944/havebike.review-now.net/web/content/admin/core PERCH_RESFILEPATH: /mnt/stor2-wc1-dfw1/400029/423944/havebike.review-now.net/web/content/admin/resources Image manipulation: GD Imagick PHP limits: Max upload 30M, Max POST 30M, Memory: 128M, Total max file upload: 30M Resource folder writeable: Yes HTTP_HOST: havebike.review-now.net REQUEST_URI: /admin/core/settings/diagnostics/ SCRIPT_NAME: /admin/core/settings/diagnostics/index.php DOCUMENT_ROOT: /mnt/stor2-wc1-dfw1/400029/423944/havebike.review-now.net/web/content
Not to worry! It's my mistake - htaccess and mod_rewrite is losing the POST data during redirection, so that's the problem I think... trying something out now.
Ok, great.
You can set the action in the form tag, or exclude the post method from your redirect.