Hey Everyone,
Had a quick question.
To start, I'm trying to allow a user to be able to edit his/her account information via a form. But I am having a problem when it comes to allowing the user to have the ability to completely leave a input value blank and have that post to the database.
Currently I have the form automatically populate the user's information inside of the input box upon the page loading like so:
<tr>
<td>First Name:</td>
<td><input type="text" name="first_name" maxlength="30" value="<? echo $user_info['first_name']; ?>" /></td>
</tr>
The above snippet populates the users first name into the input box but if the user were to delete his/her first name and push submit, it would not update the account to have no name, but instead disregard the blank field and leave the users name in the database - if that makes sense.
The above is merely an example as they should obviously have a nave in the DB.
Summary:How would I be able to populate the input with the users current information from the database (which it does currently) but allow them to delete the value entirely from the form and delete the current value from the DB?
Thanks! and let me know if that made sense