Home > Back-end >  The JSP page by clicking on a <form: radiobuttons/> button to display the corresponding div
The JSP page by clicking on a <form: radiobuttons/> button to display the corresponding div

Time:09-24

Want to click on the button radiobuttons finished, according to the corresponding item div, but cannot complete requirements, run the following code is the great god who can help?
Including the background of data transferred ${sessionScope. QuestionType} in the object of type int questionType_id, of type string questionTypeName
 
<body>



<script type="text/javascript">
The function divClick () {

Var show="";
Var apm=document. GetElementsById (" questionType_id ");
for(var i=0; IIf (apm [I]. Checked)
Show=apm [I] value;
}

The switch (show) {
Case '1' :
Document. GetElementById (" ocq) style. The display="block";
Document. GetElementById (" MCQ) style. The display="none";
Document. The getElementById (" TFQ ") style. The display="none";
break;
Case '2' :
Document. GetElementById (" ocq) style. The display="none";
Document. GetElementById (" MCQ) style. The display="block";
Document. The getElementById (" TFQ ") style. The display="none";
break;
Case '3' :
Document. GetElementById (" ocq) style. The display="none";
Document. GetElementById (" MCQ) style. The display="none";
Document. The getElementById (" TFQ ") style. The display="block";
break;
Default:
Document. GetElementById (" ocq) style. The display="none";
Document. GetElementById (" MCQ) style. The display="none";
Document. The getElementById (" TFQ ") style. The display="none";
break;
}
}
</script>

  • Related