Trouble storing initial values on a form submitted with an error
I have created a form that submits user-entered data to the database and sends the data in an email. The form also has error handling.
I have an issue when a user submits a form with errors: the fields that were filled out correctly reset to empty. This becomes annoying because the user has to re-enter all of their information.
This problem only happens with text areas, checkboxes and pulldowns. Text boxes retain the information.
So this code retains info:
<label class="control-label" for="petname">Pet Name</label>
<input id="textinput" name="petname" type="text" placeholder="Pet Name" class="form-control input-md" value="<?php echo htmlspecialchars(@$_REQUEST['petname']) ?>">
But this code doesn't:
<label class="control-label" for="title"><h3>Your Vet's Details</h3></label>
<label class="control-label" for="address">Vet's Name and Address</label>
<textarea class="form-control" rows="3" name="vetaddress" value="<?php echo htmlspecialchars(@$_REQUEST['vetaddress']) ?>"></textarea>
Any advice as to where I am going wrong would be gratefully received.
I have also attached the php file.