I am working on a form, and have fields that may or may not be filled in by the user. To keep the backend logic simple, I plan on taking all the data from the form and updating my records with all of it, regardless of what the user has entered into the fields or not.
I was told (perhaps incorrectly) that I could take the data that currently exists in the database (ie, at the time the page loads) and put it into the input area's 'value' attribute. Supposedly, this would make it that if the user does NOT enter anything into the field, the old/current values will simply be passed back to the server and re-entered (but not changed).
If the user DOES enter data, then THAT would become the new value.
So it would look something like this:
<input type='text' name='XYZ' value='<?php echo $record['XYZ']; ?>'></td>
-1--So the first question is, is this true?
The second question is that I don't want this value showing up in the actual text field. Therefore, I added a placeholder attribute to the input tag:
<input type='text' name='XYZ' value='<?php echo $record['XYZ']; ?>' placeholder=''></td>
But the value attribute seems to override the placeholder tag!
-2--So the second Q is, is there anyway to assign the value as I would like and NOT have it appear in the actual textfield?