Miva Merchant Development by Scot's Scripts

FORMS: Checkbox Check by Click on Text

Miva Random Code Trivia

Want to start an online store? We work with you from start to finish, from commerce platform to design to SEO.
Experience counts, and we have a lot.

WARNING:

This information is offered "AS IS" for internal reference only. Use at your own risk.
Does AI actually understand your Miva Merchant store? Our smart JSON-LD schema generator makes sure it does. Contact us to get started. (more info)
SEO Audit & Inquiries • News & Updates • SEO for Miva Merchant

FORMS: Checkbox Check by Click on Text

THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED;
THE AUTHOR DISCLAIMS ALL LIABILITY FOR ANY DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR STORE DISRUPTIONS ARISING FROM ITS USE.

Scot Ranney • August 15, 2024


Clicking on the text next to a checkbox should always check the box, but if you can't use FOR in the label tag to point to the checkbox input ID, there is a simple hack to get around this. Simply put everything you inside the label tag, including the input. 

In these example, clicking on the text, images, etc, will cause the checkbox to be checked.

<label>
	Click me to check the box. <input type="checkbox">
</label>


<label>
	<input type="checkbox">
	Click me or this image <img src="image.png"> to check the box.
</label>

Etc.


https://www.scotsscripts.com/mvblog/forms-checkbox-check-by-click-on-text.html

checkbox input