Home > Web Front-end > JS Tutorial > js gets the background fields and changes the selected status of the checkbox code_javascript skills

js gets the background fields and changes the selected status of the checkbox code_javascript skills

WBOY
Release: 2016-05-16 17:32:52
Original
1041 people have browsed it

Copy code The code is as follows:

Whether it is a subcontractor



  Whether it is the general contractor


  

zbr = ("Y".equals(String.valueOf(map.get("ylzd11"))))?"1":"0";////Is it the general contractor

fbr = ("Y".equals(String.valueOf(map.get("ylzd12"))))?"1":"0";//Whether it is a subcontractor
return "jzysuccess";

function init(){

//The payer type code of the general invoice 1 represents the unit 0 represents 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;
}

//Construction industry unified invoice Whether you are the general contractor
if($("#zbr").val()=='1'){
// zbr The ID of the general contractor must be accurate and unique
$("#zbr1")[0].value = true;
alert($("#zbr" ).val());
$('input[type=checkbox][value=true]')[0].checked =true;
alert($("#fbr").val() );
}else {
$("#zbr")[0].value = false;
$('input[type=checkbox][value=false]')[0].checked ==false;
}
//Construction industry unified invoice Whether it is a subcontractor
alert($("#fbr").val());
if($("#fbr ").val()=='1'){
// fbr subcontractor id must be accurate and unique
$ ("#fbr1")[0].value = true;
$('input[type=checkbox][value=true]')[1].checked =true;

}else {
$("#fbr")[0].value = false;
$('input[type=checkbox][value=false]')[1].checked =false;
}
}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template