본문 바로가기

프로그래밍/JSP

[JSP&JS] 라디오 버튼의 value값을 전달하기


라디오버튼 3개에 각각의 값을 부여하고

라디오버튼을 선택후 버튼을 눌렀을때

선택된 라디오 버튼의 value값을 전달해 넘겨주는 코드

◆--------------------------------------------------◆
JSP
◆--------------------------------------------------◆
<td style="width: 5px;"><input class="RadioBtn" type="radio"
name="Inspection_processing" id="rdo_InspectionResult" value="001"></input></td>
<td style="width: 50px;" align="left"><label>라디오버튼1</label></td>

<td style="width: 5px;"><input class="RadioBtn" type="radio"
name="Inspection_processing" id="rdo_InspectionResult" value="002"></input></td>
<td style="width: 50px;" align="left"><label>라디오버튼2</label></td>

<td style="width: 5px;"><input class="RadioBtn" type="radio"
name="Inspection_processing" id="rdo_InspectionResult" value="003"></input></td>
<td style="width: 50px;" align="left"><label>라디오버튼3</label></td>

<td style="width: 20px;"><input class='essWhite'
id="txt_searchEtc" type="text" maxlength="10" value="비고" title="비고를 입력하세요"/></td>
<td style="width: 80px;" align="right"><a
class="button blue strong" style="width: 100px"><span
id='btn_searchProcess'>입력하기</span></a></td>
</tr>
</table>

◆--------------------------------------------------◆
JS
◆--------------------------------------------------◆

vWData.addParam('Identity_Yn_Code', $('input:radio[name=Inspection_processing]:checked').val()); // 선택결과 라디오 버튼 입력