jquery How to get user-selected values

Source: Internet
Author: User
Start the Remove program $ ("#deleteDetail"). Click (function  () {///Get the ID set of the option already selected if (Confirm ("OK" to delete the chosen record? ==true) {//Get the selected record Idvar idset= "";  The string variable $ ("[name= ' did ']:checked") used to record the check box selected value. Each (function () {  //) Gets the item selected by the user based on the Name property and the checked state. It is important to note that earlier versions of jquery were not written in this way idset+=$ (this). Val () + ","; Gets the value of the selected check box and adds to the preceding string variable, notice that there is a comma,}) idset=idset.substr (0,idset.length-1);//delete the last comma if (idset== "")//If the string variable is also empty, Indicates that the user did not select the value {alert ("no record selected. ");} Else{$.ajax ({   //In Ajax method, the user selected value is passed to the background type: "Get", Data:{id:idset},datatype: "html", url: "phpcode/ Deletedetails.php ", Success:function  (data) {alert (data),}});}})

jquery How to get user-selected values

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.