Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi! I'm using the databound forms on a landing page, to record all the emails sent in the Database.

I'm using a field with validator="email" to this and, when someone sends an invalid e-mail, it should show an error message. This is the portion of the code:

Code: Select all
<cms:form method="post" masterpage="lista.php" mode="create" enctype="multipart/form-data" method="post" anchor="0">
                   
                    <cms:if k_success>
                        <cms:db_persist_form _invalidate_cache="0" _auto_title="1" />
                        <cms:redirect k_page_link />
                        <h3>Email ok</h3>
                    </cms:if>
                    <cms:if k_error>
                        <div class="error">
                        <h3>Email inválido: Verifique o e-mail informado e tente novamente</h3>
                        </div>
                    </cms:if>
                   
                    <cms:input type="bound" class="input" name="email" required="1" validator="email" placeholder="Digite seu melhor email" />
                    <cms:input class="btn mt-4 btn-grande" name="submit" type="submit" value="<cms:show textobtn />" />
                </cms:form>


My intention is to show the message "Email inválido (...)" inside the <h3> tags if the user types an invalid e-mail adress. However, when I've tested it, no message is shown. Maybe I'm doing something wrong (since I'm already in a 12 hour marathon of coding here). What could it be? Please help!

*P.S.: Sorry, english is not my native language. Hope you can understand me.
Hi,

Please put a further check about k_success right after <cms:db_persist_form> (as shown below) -
Code: Select all
<cms:if k_success>
    <cms:db_persist_form _invalidate_cache="0" _auto_title="1" />

    <cms:if k_success >
        <cms:redirect k_page_link />
        <h3>Email ok</h3>
    </cms:if>
</cms:if>

Hope this helps.
Do let me know.
Yay! It worked!

Thanks a lot, KK! \o/ :D
You are welcome :)
4 posts Page 1 of 1