![]() |
delete data using checkbox
i have a problem about using checkbox in PHP.When I click DELETE, I want to delete data in the table and also the field of the database in mysql according to the checkbox was checked. I have simple printscreen about it.
[IMG]]http://img503.imageshack.us/img503/8950/checkboxzd3.th.jpg[/IMG] |
Re: delete data using checkbox
And... so... what's the problem? If you've got this far, the rest should be simple.
Just grab the $_POST value in your .php script that corresponds to each checkbox. Then delete the data however it is being stored. Post the code if you're having a problem with that aspect. |
Re: delete data using checkbox
But I don't know how we using the chekbox before data delete. Please view me example code about this scenario :when i click DELETE button and i was checked the checkbox, field in mySQL Database have deleted according checkbox is checked. Please..Reply. Thank's before.
|
Re: delete data using checkbox
You have not shown any "example code about this scenario". Please do. I'm having a difficult time understanding you.
|
Re: delete data using checkbox
I mean, give me your example code "delete data using checkbox". When I click button DELETE, data in database MySQL have deleted according what i checked in the chekbox. i have printscreen about it [IMG]]http://img503.imageshack.us/img503/8950/checkboxzd3.th.jpg[/IMG].
Please reply. Thank's |
Re: delete data using checkbox
Please see the Javascript code-
if(para1=='Delete') { var flag=0; for (i = 0; i < document.forms[0].elements.length; i++) { var e = document.forms[0].elements[i]; if (e.type == 'checkbox' && e.name!='selectall')//check for checkbox field { if(document.forms[0].elements[i].checked == true) //check checkbox status (checked or unchecked) { flag=1; if(confirm('<?=_A_LOGICAL_DELETE_MSG?>')) { document.forms[0].submit(); } break;//exit from the loop } } } if(flag==0) { alert('<?=_A_NO_SELECT_DELETE_MSG?>'); } } Sanjay Aggarwal |
Re: delete data using checkbox
Sanjay,
Your code does not tell him how to delete those entries. It just check the data on submit. |
Re: delete data using checkbox
This thread is killing my brain cells with every word.
This is ridiculously vague. Post some code relative to your question about deleting the posted data. Or explain the specific problem in greater detail. Maybe you need to check the "name" attribute of each checkbox. And make sure you're grabbing that specific $_POST parameter. But I have nothing to go on here... All I've gotten out of your few posts so far are the words: "when I click delete mysql delete according checkbox". That won't get you very far in any language... Details. Please. |
| All times are GMT -5. The time now is 11:05 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC