jquery check box checkbox for delete

Source: Internet
Author: User

To achieve such a basic requirement, the page has a lot of data, you can delete one or more, before deleting to determine whether to select at least one, otherwise prompt.

 functionDeleteUser () {         //was trying to save the content in a str+= "" way, but no .        //var str;        varArray =NewArray ();//The ID used to save the selected data         varFlag//determine if a non-selected$ ("Input[name= ' Selectflag ']:checkbox"). each (function() {//iterate through all the checkboxes with name Selectflag                    if($( This). attr ("checked")) {//decide whether to selectFlag =true;//as long as there is a selection set to True                    }                 })        if(flag) {$ ("Input[name= ' Selectflag ']:checkbox"). each (function() {//iterate through all the checkboxes with name Selectflag                         if($( This). attr ("checked")) {//decide whether to select                            //alert (This). Val ());Array.push ($ ( This). Val ());//Add the selected value to the array                             //str+=$ (This). Val () + ",";                         }                     })            //pass data that is being collectively deleted to action processingWindow.self.location = "deleteuser?info=" +Array;}Else {Alert ("Please select at least one user");        }}

Background action to receive data for deletion

Public String Execute () throws Exception {        //TODO auto-generated Method Stub        //The foreground is the first to decompose the string in a,b,c formatString s[] = Info.split (",");         /** for (int i=0;i<s.length;i++) {System.out.println (s[i]);} */         if(S.length > 0) {              for(inti = 0; i < s.length; i++) {Userdao.deleteuser (S[i]);            }         }        return"Success";}

jquery check box checkbox for delete

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.