|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
checkbox & onClick
This is my task: when a user selects/deselects a checkbox, I want the page to refresh and update the MYSQL database.
The variable I am passing is the checkbox 'trackEnabled'. Here is my code. Please help! php Code:
|
|
#2
|
|||
|
|||
|
RE: checkbox & onClick
you forgot to state your problem
|
|
#3
|
|||
|
|||
|
RE: checkbox & onClick
It's not working!
Ok, well I get it to refresh all right... however, it doesn't seem to update the database. |
|
#4
|
|||
|
|||
|
RE: checkbox & onClick
is it passing trackEnabled okay? because without actually submitting the form i'm not sure it'll take the POST method.. maybe your value is within $_GET or $_REQUEST
|
|
#5
|
|||
|
|||
|
RE: checkbox & onClick
I just did print_r{$_POST) and it isn't returning anything.
arghh |
|
#6
|
|||
|
|||
|
RE: checkbox & onClick
and so what about print_r($_REQUEST) ?
|
|
#7
|
|||
|
|||
|
RE: checkbox & onClick
When I do print_r($_REQUEST)
I get: Array ( [sessionID] => 1 ) |
|
#8
|
|||
|
|||
|
RE: checkbox & onClick
|
|
#9
|
|||
|
|||
|
RE: checkbox & onClick
Sorry to butt in, but one other thing you could do is change the onChange event to submit the form instead of doing a location redirect. it would look something like
onChange="document.form.submit()" It would probably be beneficial to give the form a name and then use that name in the onChange event. That way you shouldn't have to change anything else in the script. |
|
#10
|
|||||
|
|||||
|
RE: checkbox & onClick
Here is my code with changes. I can't seem to get it to update still... When I do print_r, I get an array but with the wrong trackEnabledID... it only reads the LAST entry...
php Code:
|
|
#11
|
|||
|
|||
|
RE: checkbox & onClick
Quote:
|