Skip Navigation

[Resolved] Make a declaration checkbox in post form

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#2616649
Screenshot 2023-06-18 at 12.27.16 AM.png
Screenshot 2023-06-18 at 12.29.37 AM.png

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 >
#2616889

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