Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi KK,
I realise my form doesn't validate when the the action attribute to set to another script as seen below:
Code: Select all
<cms:form class="hero-search" method="get" action="<cms:link 'property.php' />">

<cms:input type="text"  name="location"  id="pxp-p-search-address" placeholder="Enter address..." required='1' />

<cms:if k_error_location ><cms:show k_error_location /></cms:if>
......
</cms:form>


Is that supposed to be a default behaviour or I am missing something? Thank you
When you press submit, by default the form gets submitted to the same URL (i.e. the same template which has your code) so the <cms:form> code gets to do the validation etc.

If 'action' is set to some other location, pressing submit will send the submission to that location - your <cms:form> code is not present there and hence no further processing.

Hope this explains what is happening.
Ok KK,
I get the whole concept now. Thanks for the explanation. I will fall on JS do to the validation. Thank you very much.
3 posts Page 1 of 1