vinpkl — 2012-10-08T04:24:32-04:00 — #1
In "change address details" form i m displaying all fields values as
<input type="text" name="user_city" value="<? echo row['user_city']) ?>" />
<input type="text" name="user_country" value="<? echo row['user_country']) ?>" />
I m validating the form with php and showing errors through php
so after click of submit button i want to retain form values and display
1) new data values entered in input fields (in which user made changes)
2) old data values from database in which user didnt made any changes
cups — 2012-10-08T13:30:05-04:00 — #2
So what you are saying is you want to display what is currently in the database?
If so, the code should read roughly:
do update of new values into db
select the new row again
display the new row's values into the form
If this is not what you mean, then explain further.
kylewolfe — 2012-10-08T15:40:55-04:00 — #3
I think you may be referring to if something fails (such as missing a required field), you do not want the user to lose what they have already entered, even if those changes my not yet be stored in the table.
Depending on how your set up, you may need to set the array of their updates to a session so that it can survive multiple HTTP requests, and then be called later to populate the form again.