1

I'm trying to display an inline validation error when these two fields do not match:

 {freeform:field:email} 
 {freeform:field:email_confirm}

Which outputs the following html:

 <input type="text" name="email" value="" id="freeform_email">
 <input type="text" name="email_confirm" value="" id="freeform_email_confirm">

And I have the matching_fields="email" parameter set in the freeform tag.

And I have this configured for the error messages:

 {if freeform:error:email}Please fill in your email<br>{/if}
 {if freeform:error:email_confirm}Confirm email does not match<br>{/if}

The issue is that if the fields do not match, it displays the message from the email field rather than the email_confirm field.

So if the error is because the confirm email doesn't match or isn't populated, the "Please fill in your email" message obviously doesn't make sense.

Is it possible to display the email_confirm error in this case?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.