Js changes the checkbox selected status

Source: Internet
Author: User

Function init (){
// Common invoice payer type code 1 stands for the unit 0 stands for the individual
If ($ ("# fkfLxDm"). val () = '1 '){
$ ('Input [type = radio] [value = 1] ') [0]. checked = true;
} Else if ($ ("# fkfLxDm"). val () = '0 '){
$ ('Input [type = radio] [value = 0] ') [0]. checked = true;
}

// Whether the unified invoice for the construction industry is the total contractor
If ($ ("# zbr"). val ()){
$ ("# Zbr") [0]. value = true;
$ ('Input [type = checkbox] [value = true] ') [0]. checked = true;
} Else {
$ ("# Zbr") [0]. value = false;
$ ('Input [type = checkbox] [value = false] ') [0]. checked = false;
}
// Whether the unified invoice for the construction industry is the package owner
If ($ ("# fbr"). val ()){
$ ("# Fbr") [0]. value = true;
Alert ($ ("# fbr"). val ());
$ ('Input [type = checkbox] [value = true] ') [1]. checked = true;

} Else {
$ ("# Fbr") [0]. value = false;
$ ('Input [type = checkbox] [value = false] ') [1]. checked = false;

}

<Td width = "15%" align = "left"> whether it is a package </td>
& Lt; td width = "35%" align = "left" & gt;
<Input type = "checkbox" NAME = "fbr" id = "fbr">

</Td>


 

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.