If a user decides to pay for their insurance via direct debit a 7% interest charge is applied to their total.
i have the following code in place:
[code=php]
if ((isset($_POST[‘mySelect’])) == ‘ddm’)
{
$pretotal = $total * (7/100);
$ddm_total = $total + $pretotal;
}
this only runs when the form is submitted.
the selectbox it applies to is:
[code=php]
<select id=”mySelect” name=”mySelect” size=”1″ onclick=”return displayDiv(this.selectedIndex)” value=’$mySelect’ title=”Your Payment Method”>
<option value=”0″ <? if(isset($_SESSION[‘mySelect’]) && $_SESSION[‘mySelect’] == ‘0’) { ?>selected=”selected”<? } ?> />Please Select…</option>
<option value=”ddm” <? if(isset($_SESSION[‘mySelect’]) && $_SESSION[‘mySelect’] == ‘ddm’) { ?>selected=”selected”<? } ?> />Direct Debit</option>
<option value=”cc” <? if(isset($_SESSION[‘mySelect’]) && $_SESSION[‘mySelect’] == ‘cc’) { ?>selected=”selected”<? } ?> />Credit Card</option>
</select>
the dilema i have is the onClick command is being used for the function to display either method of paying.
has anyone any suggestions?