I am creating a form input which the minimum amount for submitting is 700. Any values more than 700 should be taken as extra savings. It should save 700 as amount and the excess as extra saving. The form is working fine for values greater than 700 showing that my code works but it does not submit for input that is exactly 700.
$extra_savings = 0;
if ($amount_saved > 700) {
$extra_savings = $amount_saved - 700;
$amount_saved = 700;
}
// validate input
$valid = true;
if (empty($amount_saved)):
$amount_savedError = 'Please enter amount saved';
$valid = false;
elseif ($amount_saved < 700):
$amount_savedError = 'Amount Saved Should be 700 or more';
$valid = false;
else:
$valid = true;
endif;
Where is the problem?