Hi,
That can be easily achieved by the use of the regular 'if - else' tags.
As an example please take a look at the following -
Code:
<cms:input type="text"
name="email"
label='Email'
maxlength="100"
validator='email'
required='1'
class="required<cms:if k_error_email> myerror</cms:if>"
/>
Normally the code above will output this HTML
Code:
<input type="text" name="email" id="email" value="" maxlength="100" class="required"/>
However upon encountering error in submission, the 'if' block will kick in to add the 'myerror' class -
Code:
<input type="text" name="email" id="email" value="" maxlength="100" class="required myerror"/>
Please notice that within the 'if' block we have purposefully placed a space before 'myerror' string. Without this space the output would have been
Code:
<input type="text" name="email" id="email" value="" maxlength="100" class="requiredmyerror"/>
Do let me know if this helped.