Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prechecked checkboxes not retaining

Status
Not open for further replies.

SPrelewicz

Programmer
Jul 16, 2001
124
US
I am prepopulating checkboxes from MySQL. This works just fine. When I go to the form, the values that are stored in the database are in fact prechecked. (Using HTML CHECKED in the checkbox tag). If I select a few more checkboxes, however, and submit, ONLY the new ones that I manually checked are being passed in.

I looked around as to why this mat be, but cant find anything. This may be something common and basic in PHP, but I'm not aware of it. Has anyone run into this, and what is the solution, aslo, why does this happen?

Thanks.
 
This is one of my many dumb moves, but I solved it. In the if checked conditional, if it was checked I wasnt putting in the name=checkboxes[] in the generated HTML, only in the else. Beleive it or not, your asking for the HTML made me see the error, so thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top