I want to make a declaration checkbox in post form, I want to have same error message on top of the message like other field, currently I make it as a custom field but it can't allow me to add a hyperlink to the text. Could you please advise me how I can make the HTML and do the same outlook as I make the custom field? How do I show the error message on top, please also advise me the code that support translation.
<input type="checkbox" name="declaration" required >
Hi,
Thank you for contacting us and I'd be happy to assist.
Your observation is correct and the checkbox type field's label doesn't allow the inclusion of the HTML link tags.
A workaround that you can use in this case is to, add an 'HTML content' field below the checkbox type field in the form. The text and the link for the terms and conditions page can be included in this HTML content field instead, e.g.:
<p>Link to our <a href="{link to the page}">terms and conditions page</a>.</p>
I understand that this link and text won't be in line with the checkbox field, but this is the most simple workaround that you can use that doesn't involve code customization and it is also translation friendly.
regards,
Waqar