Jump to content

problem with html option selected not updating


jrgord

Recommended Posts

Not sure exactly where this problem is coming from, but php seems the most likely candidate to fix it.  My php loads, from a MySQL database, a list of names (students in a class) and a drop-down for each student with attendance options.  Based on the information in the database, the appropriate attendance option is selected (<option selected></option>).  Everything works fine on the initial page load. 

 

Next, I want to update the status, so I select a new option from the drop-down list and click submit.  The php code updates the database correctly, but the selected option (in HTML) is still the original one.  If I change the option to something different and submit again, I get the previously selected option (that I selected the first time) - in essence, the HTML is always one step behind the database.

 

I've attached the snippet of relevant code - again, I know that the code works when the page loads initially and that the database is getting updated correctly.  Any help or comments are appreciated.

 

[attachment deleted by admin]

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.