|
Posted by Daz on 10/08/06 18:13
Hi everyone.
Firstly, I apologise if this i not what you would call a PHP problem. I
get quite confused as to what lives in which realm, so if this
shouldn't be posted here, please suggest where I should post it.
I have created a form, which consists of a list of items, each with a
checkbox. When a checkbox is checked or unchecked, the page should be
refreshed. During the refresh, the data is validated and the MySQL
database is updated etc...
The problem I am having is using onchange (which I believe is
javascript). When I check a box, everything works great, the database
updates as it should, the page refreshes and reflects the change.
However, when I 'uncheck' the box. for some reason, it posts the value
of the last checkbox that was checked, and unchecks that... I am trying
to find a pure PHP method (even though I accept that I will need to
learn Javascript sooner or later), which will help me find the one box
that was unchecked, (as it's almost impossible to check more at any one
time as the page refreshes immediately).
The list of items can be filtered, and there are just under 3600 items
in total (hence why they are filtered). Each items has a uniique id, so
to save iterating through every possible checkbox, and cross
referencing each one with the database to see which one has changed, I
named each checkbox 'check' and the value of each one contains the 'id'
of the item in the list.
As far as I know, this should work fine, as it should submit the value
of the checkbox that was clicked when it's clicked upon, but it's not
working for unclicked checkboxes.
Any input would be appreciated.
Navigation:
[Reply to this message]
|