Forum Moderators: coopster

Message Too Old, No Replies

Multiple Action on Checkbox

Toggle action

         

Saint Honore

9:54 am on Jul 13, 2006 (gmt 0)

10+ Year Member



Hi everybody,
How do i toggle the action based on the selection of checkboxes?
Iam dispalying all the records from DB, I have fields called Id and arc. Iam displyaing checkboxes for both the field. Now if I select Id checkbox and click on sumbit then it shld delete the records of selected ID and if i select arc checkboxes then it shld update those records and set the value of arc field to 1.
How can I do this?

Regrds

Saint Honore

10:12 am on Jul 13, 2006 (gmt 0)

10+ Year Member



Hi,
I figured out myself, for delete but how do i find out if the action is for delete or if it is for archieveing?

[edited by: Saint_Honore at 10:16 am (utc) on July 13, 2006]

le_gber

2:49 pm on Jul 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



call your checkboxes

<input type="checkbox" name ="action[]" value="archive" />
<input type="checkbox" name ="action[]" value="delete" />

note the [ ] at the end of the checkbox name

this will pass the value of the checkbox as an array which you'll be able to foreach, if or switch.

Saint Honore

2:59 am on Jul 15, 2006 (gmt 0)

10+ Year Member



Hi Thanks,

I'll give you a try now