Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi Couch!!!


Captudfsdfsdre.PNG
Captudfsdfsdre.PNG (7.51 KiB) Viewed 1783 times



How to change the "k_author", "k_email" and "k_comment" to just "author", "email" and "comment" ?


;)
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
Hi,

The answer lies in how you choose to process the error condition of a Couch form (http://www.couchcms.com/docs/concepts/forms.html).

From the screenshot it appears to be the following (where we are simply iterating through the generic 'k_error' variable that contains error messages for all fields) -
Code: Select all
<cms:if k_error >
    <cms:each k_error >
        <cms:show item />
    </cms:each>
</cms:if>

You can make that code into the following where we check for each individual field and output the message of our choice -
Code: Select all
<cms:if k_error >
    <cms:if k_error_k_author >Your name is required<br/></cms:if>
    <cms:if k_error_k_email >Your Email is required<br/></cms:if>
    <cms:if k_error_k_comment >Please enter something as comment<br/></cms:if>
    <cms:if k_error_captcha >Captcha is incorrect<br/></cms:if>
</cms:if>

Hope this helps.
KK wrote: Hi,

The answer lies in how you choose to process the error condition of a Couch form (http://www.couchcms.com/docs/concepts/forms.html).

From the screenshot it appears to be the following (where we are simply iterating through the generic 'k_error' variable that contains error messages for all fields) -
Code: Select all
<cms:if k_error >
    <cms:each k_error >
        <cms:show item />
    </cms:each>
</cms:if>

You can make that code into the following where we check for each individual field and output the message of our choice -
Code: Select all
<cms:if k_error >
    <cms:if k_error_k_author >Your name is required<br/></cms:if>
    <cms:if k_error_k_email >Your Email is required<br/></cms:if>
    <cms:if k_error_k_comment >Please enter something as comment<br/></cms:if>
    <cms:if k_error_captcha >Captcha is incorrect<br/></cms:if>
</cms:if>

Hope this helps.


ayyy :D i love you much KK

thx
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
3 posts Page 1 of 1
cron