Jump to content

How to make entries remain on the form after clicking submit button ?


tmyonline

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.