Jump to content

php form


samona

Recommended Posts

Is there a way to show only the part of a form which has not yet been completed using php?  For example, I have a form that is linked to a database, however, the fields of the form which have already been submitted successfully should not appear on the form again the next time the user tries to fill it out. 

Link to comment
Share on other sites

Sounds like they want the Form Input to not show up at all for those fields.

 

 

Is there a way to show only the part of a form which has not yet been completed using php?  For example, I have a form that is linked to a database, however, the fields of the form which have already been submitted successfully should not appear on the form again the next time the user tries to fill it out. 

Link to comment
Share on other sites

I am reading the information from a database, so for example:

 

In the table named Tasks I have the following records:

 

Finished Homework | 5:00 PM

Done Shopping      | 6:00 PM

 

Now in the form, since I have already completed these tasks,

I don't want to have the option of selecting them.

 

My code is

 

<form action="checklist.php" method="post">
<input type="checkbox" name="task[1]" value="1">Finished Homework
<input type="checkbox" name="task[2]" value="2">Done Shopping
<input type="checkbox" name="task[3]" value="3">Watching TV
<input type="submit" name="submit" />

 

Now, since the records Finished Homework and Done Shopping are already in the database, I don't want to give the user the option of checking those boxes again.  So I thought maybe if I could keep them from being displayed that way they can't add a duplicate record for the same task.  Am I even going about this the right way? Any help will be appreciated.

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.