• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Check Box question

 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, good day, if i have many checkbox , how do i keep track how many checkbox user have been select , so that we can delete the related items, it work similar like deleting email ? thank you
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you submit the form it should contain all of the checkboxes that have been selected. Not sure what you are looking for exactly.

Eric
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, eric , say i have many row in table, i want to make check box beside on each row , when user select it , and after user click delete , then the row been selected can be delete or erase ..
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript will only make this a temporary delete. Is that what you are after?
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nope, eric, after user select the checkbox that for deletion, i want to make it permanent deletion to be happen ..
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you are going to have to use server side code since JavaScript can not make it permanent.

Eric
 
Vijay Vaddem
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be this could be helpful...
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks eric and Vijay Vaddem , it a good sample
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In one of my previous project there was a requirement like this ..

A jsp displays a database table for each row a check box is provided ..
so that onSubmit all the rows corresponding to the selected checkboxes should get deleted from the DB ( some thing like a email).

This was our solution
The check boxes were created in runtime by the jsp ( each row has a check box).
The name of each check box is the value of the primary key from the table.
When any chek box is selected a hidden textfield is updated with this NAME OF THE selected check box
At last the hidden text will have comma seperated values that corresponds to the selected values in check box like this ( 1,2,3,4, )
On Submit this comma seperated value is passed to a stored procedure that deletes all the selected records.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic