On the product pages we have a code like this:
etc.Code:<select name="paymentmethod1" id="paymentmethod1"> <option value="MoneyPak">MoneyPak</option> </select> <select name="paymentmethod2" id="paymentmethod2"> <option value="MoneyPak">MoneyPak</option> </select
Through Session it writes to the order checkout form header as text such as MoneyPak or Credit Card through the code:
Now what I am trying to do here is get the user selection of Credit Card or MoneyPak radio button from the product page to automatically trigger the corresponding radio button to be checked:Code:<?php echo($_SESSION["paymentmethod".$counter]); ?>
I was thinking it could be something like this maybe but I can't get it to work:Code:<input name="1" type="radio" class="radio2" id="creditcard" style="padding-left:0px" onclick="showhide('creditcardxx', 'block'); showhide('m-p-kx', 'none'); showhide('splitx', 'none'); showhide('charge', 'block'); showhide('option3m', 'none'); showhide('option3', 'none'); showhide('option2', 'block')" value="creditcard"/>
I also don't know if I should have else in both radio buttons or not.Code:<input name="1" <?php if (echo($_SESSION["paymentmethod".$counter])=='MoneyPak') { echo checked="checked" ;} ?> type="radio" class="radio" id="MoneyPak" onclick="showhide('m-p-kx', 'block'); showhide('splitx', 'none'); showhide('creditcardxx', 'none'); showhide('paypalx', 'none'); showhide('charge', 'none'); showhide('option3', 'none'); showhide('option3m', 'none'); showhide('option2', 'none');" value="MoneyPak">



Reply With Quote

Bookmarks