[FIX] website_crm: move the input hidden generated with kwargs at bottom of the form. Else, if the args is a field displayed later, form never look about the new value and error remains. When we post a form with 2 fields with the same name, we got only the first one into kwargs from controller.

This commit is contained in:
Jeremy Kersten 2014-10-03 22:26:26 +02:00
parent 24bec094c2
commit ab7b5d7732
1 changed files with 4 additions and 3 deletions

View File

@ -5,9 +5,6 @@
<template id="contactus_form" name="Contact Form" inherit_id="website.contactus" customize_show="True">
<xpath expr="//div[@name='mail_button']" position="replace">
<form action="/crm/contactus" method="post" class="form-horizontal mt32" enctype="multipart/form-data">
<t t-foreach="kwargs" t-as="kwarg">
<input type="hidden" t-att-name="kwarg[0]" t-att-value="kwarg[1]"/>
</t>
<div t-attf-class="form-group #{error and 'contact_name' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="contact_name">Your Name</label>
<div class="col-md-7 col-sm-8">
@ -38,6 +35,10 @@
<textarea class="form-control" name="description" style="min-height: 120px" required="True"><t t-esc="description or ''"/></textarea>
</div>
</div>
<t t-foreach="kwargs" t-as="kwarg">
<input type="hidden" t-att-name="kwarg[0]" t-att-value="kwarg[1]"/>
</t>
<div class="form-group">
<div class="col-md-offset-3 col-sm-offset-4 col-sm-8 col-md-7">
<button class="btn btn-primary btn-lg">Send</button>