KK, that's the solution!
To have the same error styling as the rest of the dynamic form the final code becomes:

To have the same error styling as the rest of the dynamic form the final code becomes:
- Code: Select all
<cms:form anchor='0' method="post">
<cms:if k_success>
<!-- take action using the submitted data - like email -->
<p>Thank you. We´ll get back to you soon.</p>
<cms:each k_success sep='\n'>
<cms:show item /><br>
</cms:each>
</cms:if>
<cms:show_repeatable 'form' >
<cms:php>
global $FUNCS, $CTX;
$name = $FUNCS->get_clean_url( $CTX->get('title') );
$CTX->set( 'name', $name );
</cms:php>
<p>
<label for="<cms:show title />"><cms:show title /></label>
<cms:input
type="<cms:if type='email'>text<cms:else /><cms:show type /></cms:if>"
name="<cms:show name/>"
id="<cms:show name/>"
required="<cms:show required />"
validator="<cms:if type='email'>email</cms:if>"
validator_msg="<cms:if text>required=<cms:show text /><cms:if type='email'> | email=<cms:show text /></cms:if></cms:if>"
opt_values="<cms:show options />"
/>
</p>
<cms:set my_error="<cms:get "k_error_<cms:show name/>" />" />
<cms:if my_error>
<div class="alert">
<p id="<cms:show name/>_error" class="error"><cms:show my_error /></p>
</div>
</cms:if>
</cms:show_repeatable>
<label class="required" for="human">Are you human? Is sky <strong>blue</strong> or green? (4 characters required)</label>
<cms:input type="text" required='1' validator='regex=/^blue$/i' class="input-text required-entry" id="human" name="human"/>
<cms:if k_error_human>
<div class="alert">
<p>Please answer the question</p>
</div>
</cms:if>
<input type="submit" value="Submit"/>
</cms:form>