My form with radio buttons works perfectly on the computer, but encounters issues on mobile devices. Users are required to double-tap to select a radio button, causing confusion.
Is there a way to disable the double-tap requirement? I've looked at other solutions, but they use different code which I'm unsure how to implement in my situation.
Any assistance would be greatly appreciated.
Here's the current code I have:
function myFunction() {
if(document.getElementById('monthly').checked) {
document.getElementById('myLink').href = "https://www.rageheart.co/beast-monthly";
}
if(document.getElementById('yearly').checked) {
document.getElementById('myLink').href = "https://www.rageheart.co/beast-yearly";
}
if(document.getElementById('onemonth').checked) {
document.getElementById('myLink').href = "https://www.rageheart.co/beast-1-month";
}
}
<form><div class="monthly-box"><label for="monthly" class="container">
<div class="monthly-header">Most Popular</div>
<div class="monthly-body">
<div class="monthly-input"><input type="radio" id="monthly" name="payment" value="monthly" checked="checked"><span class="checkmark-monthly-yearly"></span></div>
<div class="monthly-text">
<h2>Monthly Subscription - $79 USD <span style="color:#929292;font-weight: normal;"><s>$99</s></span></h2>
<ul>
<li>60 recorded audio lessons + live class on Zoom</li>
<li>1-on-1 welcome call with the founder</li>
<li>7-Day Free Trial + 90-Day Money Back Guarantee</li>
</ul>
</div>
</div>
</label>
</div>
<div class="yearly-box"><label for="yearly" class="container">
<div class="yearly-header">Best Value</div>
<div class="yearly-body">
<div class="yearly-input"><input type="radio" id="yearly" name="payment" value="yearly"> <span class="checkmark-monthly-yearly"></span></div>
<div class="yearly-text">
<h2>Yearly Subscription - $474 USD <span style="color:#929292;font-weight: normal;"><s>$1,188</s></span></h2>
<ul>
<li>60 recorded audio lessons + live class on Zoom</li>
<li>1-on-1 welcome call with the founder</li>
<li>14-Day Free Trial + 90-Day Money Back Guarantee</li>
</ul>
</div>
</div>
</label>
</div>
<div class="onemonth-box"><label for="onemonth" class="container">
<div class="onemonth-header"></div>
<div class="onemonth-body">
<div class="onemonth-input"><input type="radio" id="onemonth" name="payment" value="onemonth"><span class="checkmark-onemonth"></span></div>
<div class="onemonth-text">
<h2>Try One Month - $99 USD</h2>
</div>
</div>
</label>
</div>
</form>
<a href="" onclick='myFunction()' id="myLink">Checkout →</a>