JQuery is a way to get the same level (for example, in the GridView) _ jquery

Source: Internet
Author: User
JQuery is a way to get the same level value. For example, if you are in the GridView, the implementation code is as follows. For more information, see The Code is as follows:














You want to take the value in the hidden field after the selected checkbox, as follows:

The Code is as follows:


Function SelectReceipt ()
{
Var checknum = 0;
Var customerCode = "";
Var type = "";
Var url = "";
Checknum = $ ("input: checked"). length;
If (checknum> 1)
{
Alert ("only one record can be selected for collection! ");
Return false;
}
Else
{
Alert (checknum );
If (checknum = 1)
{
CustomerCode = $ ("input: checked "). next (). attr ("value"); // you can use the next () method to obtain the value of the next hdCustomerName. next (). next ().
// CustomerName = $ ("input: checked ~ # HdCustomerName "). val (); // the ID of IE will report an error, firefox will not
Type = $ ("input: checked ~. HdStatus "). attr (" value "); // or you can use the class method to obtain the value,
Url = 'prereceiptdeposit. aspx? CustomerCode = '+ customerCode +' & departmentType = '+ type;
}
Else
{
Url = 'prereceiptdeposit. aspx? CustomerCode = '+ ''+' & departmentType = '+ type;
}
Alert (url );
Universalopenwindowandbreak( 640,600, url, 1 );
Return true;
}
}


JQuery -- checkbox select all/cancel all

The Code is as follows:




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.