My php form validation is OK. I want to keep user entered data in the form when it is represented to the user (i.e., if an error occurs). I can do with for text entries using this code:
<input type="text" name="firstname" id ="firstname" value = "<?php echo $firstname;?>" >
And for radio buttons using this code:
<input type="radio" name="entree" <?php if (isset($entree) && $entree =="chicken") echo "checked";?> value = "chicken">Chicken
But I can't get it to work for decimal inputs, using the following code.
<input type="DECIMAL(4,2)" name = "meal_cost" id ="meal_cost" value = "<?php echo htmlspecialchars($meal_cost);?>">
I will appreciate any help from Stackoverflow