![]() |
I try to determine if a variable is set and if so then the checkbox is selected. I tried it with this code but it dont works, when i execute it then all the checkboxes are checked while only one field is filled with aw so 1 checkbox has 2 be checked instead of all :(
PHP Code:
PHP Code:
Hope someone can help me out, any help is appreciated. |
i've laready asked 5 times for this :( looks like we'll have to wait to v 3 to me :(
|
Try this...
PHP Code:
|
Thanks for the replies
@firefly, that didnt worked. I tried this code and it works now :up: PHP Code:
|
You need to set a hidden field saying the field WAS there, and then in the parsing if the variable doesn't exists (=checkbox is not checked) remove the row.
|
Cool, thanks Firefly. I gonna test that out.
Be Right Back :D |
i'm going crazy :D
i'm using the following code: PHP Code:
1. Awards name with the awardsid 9 and aw is also 9 2. Lesane with the awardsid 13 and aw is empty (means not checked) So when i execute the script then i c awards name selected and lesane is not selected and if i check the code by <input type =hidden then i c: <input type='hidden' name='delete[]' value='aw[13]'> so thats right, lesane is not selected and have the id 13. Now i'm totally confused because when i click on submit then it deletes lesane totally and when i uncheck the award with the name "awards name" then that aw is not gonna deleted because only the input type = hidden was lesane :( So my questions are: Whats the delete query to delete only the aw row from awards where awardsid=? & How is it possible to delete the aw row from the award called "Awards Name" when i uncheck him? I hope u have a solution :( |
working now or not
|
firefly why ican't download attachment
|
No, its still not working.
When i try 2 unselect a checkbox and press on submit then he must delete the variable from that table :?: |
Quote:
|
Ok, just talking in general here, but you should get the point.
If you look in the hacks database you will see something like this: Code:
<tr align="center"> Then there's the real checkbox, that the user can change. That's part of the install[] array, which holds all the ID's of the hacks the user WANTS to have installed. And here's a little bit of code from the page itself, that parses the results: PHP Code:
And then it's really simple logic! If the hack wasn't installed ($was equals 0) and it SHOULD be now ($now equals yes), then we need to install the hack. Otherwise, if the hack WAS installed ($was is 1) but the user un-checked the box (so $now is not yes), we need to un-install the hack. If non of the above is true, it means that the hack is either already installed and the user didn't touch the checbox, or it is not installed but the user didn't check the checkbox neither. *takes a deep breath* :) Did I say I was talking in general? :D |
Thanks Firefly, it works almost 100%.
However one thing: $threadid. Where and how did u defined that one because i get an error: PHP Code:
This is my currently code: PHP Code:
Its a little general ;):D |
1. What's this $kol crap? The checkbox value is always yes!
2. The whole part where you list the array and do your stuff is AFTER you SUBMIT the form, not while printing it. |
1.
PHP Code:
2. Quote:
Its working perfect now, thank you for your help Firefly. Appreciated. |
Quote:
How did you defined the value yes? |
firefly, it works perfect if i have just 1 award but when i have more then 1 award then it updates the database only with the last award, it only listening to the last award. So if i have 2 awards then it updates only the 2nd award and ignores the 1st one. Could u help me with this (hopefully) last problem ;)
I have the currently code: Code before submit: PHP Code:
Code after submit: PHP Code:
|
Nevermind, i got it working now :up: :)
|
All times are GMT. The time now is 10:19 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|