tmyonline Posted November 17, 2007 Share Posted November 17, 2007 Hi guys: My page has two parts; part I on top is where users enter data. After they enter data and click "save", those data will be displayed in part II (in the bottom of the same page). Is there a way that I can make the input data remain on the form after users click the save/add-row/remove-row button ? This is needed in case users need to make changes to their entries; if they are all gone upon the clicking of a button, the users will have to re-type everything from scratch and they can get mad at me for this! I was trying to use session variables to store the values but I wasn't sure how to do this for input values. Here's a sample of my code: for ($j = 1; $j <= 6; $j++) { echo '<td>'; echo "<input type=\"text\" name=\"text_" . "1" . "$j\" /><br />"; echo "<input type=\"int\" name=\"image_" . "1" . "$j\" /><br />"; echo "<input type=\"int\" name=\"material_" . "1" . "$j\" /><br />"; echo '</td>'; } Any idea or alternatives ? Thanks a lot. Quote Link to comment Share on other sites More sharing options...
rarebit Posted November 17, 2007 Share Posted November 17, 2007 Get the inputted data: $name = $_POST['name']; When generate form, use the inputted data: <input type='text' name='name' value='".$name."'> Quote Link to comment Share on other sites More sharing options...
rarebit Posted November 17, 2007 Share Posted November 17, 2007 P.S. Use code tags! (#) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.