I want the $delivery
in the top input to change value depending on the value on another variable I'm using.
I'm just not sure how to place another if inside the current if and how to match up the value="0.00"
so it all works together
<form action="" method="post" onclick="this.submit()">
<input <?php if ($delivery=='0.00'){ echo 'checked="checked"';} ?> type="radio" value="0.00" name="delivery"> Economy - up to 4 working days<br>
<input <?php if ($delivery=='4.99'){ echo 'checked="checked"';} ?> type="radio" value="4.99" name="delivery"> Express - next day <br>
<input <?php if ($delivery=='9.99'){ echo 'checked="checked"';} ?> type="radio" value="9.99" name="delivery"> Saturday<br>
</form>
Thanks.
What i ended up doing was this:
if ($pricetotal <= 50.00) {
$amount1 = 3.99;
}
elseif ($pricetotal >= 50.01) {
$amount1 = 0.00;
}
Then in my form changing it to this:
<form action="" method="post" onclick="this.submit()">
<input <?php if ($delivery<='3.99'){ echo 'checked="checked"';} ?> type="radio" value=" <?php echo htmlspecialchars($amount1); ?>" name="delivery"> Economy - up to 4 working days<br>
<input <?php if ($delivery=='4.99'){ echo 'checked="checked"';} ?> type="radio" value="4.99" name="delivery"> Express - next day <br>
<input <?php if ($delivery=='9.99'){ echo 'checked="checked"';} ?> type="radio" value="9.99" name="delivery"> Saturday<br>
I might not have explained exactly what i needed as i thought there would be a simple fix, but i wanted the top inputs value do change depending on $pricetotal
and i managed to get it working.
Thanks for the help.