html 라디오버튼 값처리
페이지 정보
본문
<script type=\"text/javascript\">
function checkcounter(f){
var size = f.insutest.elements['check01'].length;
var yescounter =0;
//alert(f.insutest.elements['check01'][0].checked);
for (var p=1;p<11;p++ )
{
if(f.insutest.elements['check'+p][0].checked == true){ yescounter+=1}
}
alert(yescounter);
for (var i=0;i<2;i++)
{
if(f.insutest.elements['check01'][i].checked){
//alert(f.insutest.elements['check01'][i].value);
}
}
}
</script>
<form name=\"insutest\" method=\"get\">
<table class=\"my_table\">
<colgroup>
<col width=\"630px\">
<col width=\"\">
</colgroup>
<tr>
<td><p class=\"my_c_01\">나에게 꼭 필요한 보험을 잘 알고 있다.</p></td>
<td><input type=\"radio\" id=\"check01\" name=\"check1\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check01\" name=\"check1\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_02\">보장성보험을 2개이상 가입하였다.</p></td>
<td><input type=\"radio\" id=\"check02\" name=\"check2\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check02\" name=\"check2\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_03\">가입한 보험의 보장에 대해서 충분히 알고 있다.</p></td>
<td><input type=\"radio\" id=\"check03\" name=\"check3\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check03\" name=\"check3\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_04\">갱신 비갱신형이 무슨 뜻인지 잘 알고 있다.</p></td>
<td><input type=\"radio\" id=\"check04\" name=\"check4\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check04\" name=\"check4\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_05\">은퇴후 노후를 위한 연금보험,연금저축을 가입했다.</p></td>
<td><input type=\"radio\" id=\"check05\" name=\"check5\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check05\" name=\"check5\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_06\">보험료가 부담되어 리모델링을 생각해 본 적이 있다.</p></td>
<td><input type=\"radio\" id=\"check06\" name=\"check6\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check06\" name=\"check6\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_07\">보험 비교사이트에 상담을 받아본 적이 있다.</p></td>
<td><input type=\"radio\" id=\"check07\" name=\"check7\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check07\" name=\"check7\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_08\">필요에 맞게 보험종목을 쪼개서 가입할 생각이다.</p></td>
<td><input type=\"radio\" id=\"check08\" name=\"check8\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check08\" name=\"check8\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_09\">생명보험, 손해보험 차이를 알고 있다.</p></td>
<td><input type=\"radio\" id=\"check09\" name=\"check9\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check09\" name=\"check9\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_10\">지인의 권유보단 비교하여 가입하는 것이 알맞다.</p></td>
<td><input type=\"radio\" id=\"check10\" name=\"check10\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check10\" name=\"check10\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
</table>
<!--<a class=\"my_f_btn\" href=\"my_result_a.php\">--><a class=\"my_f_btn\" href=\"javascript:checkcounter(this);\"><img src=\"../img/my_insu/my_insu_btn.jpg\" title=\"나의보험 진단하기\"></a>
</form>
function checkcounter(f){
var size = f.insutest.elements['check01'].length;
var yescounter =0;
//alert(f.insutest.elements['check01'][0].checked);
for (var p=1;p<11;p++ )
{
if(f.insutest.elements['check'+p][0].checked == true){ yescounter+=1}
}
alert(yescounter);
for (var i=0;i<2;i++)
{
if(f.insutest.elements['check01'][i].checked){
//alert(f.insutest.elements['check01'][i].value);
}
}
}
</script>
<form name=\"insutest\" method=\"get\">
<table class=\"my_table\">
<colgroup>
<col width=\"630px\">
<col width=\"\">
</colgroup>
<tr>
<td><p class=\"my_c_01\">나에게 꼭 필요한 보험을 잘 알고 있다.</p></td>
<td><input type=\"radio\" id=\"check01\" name=\"check1\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check01\" name=\"check1\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_02\">보장성보험을 2개이상 가입하였다.</p></td>
<td><input type=\"radio\" id=\"check02\" name=\"check2\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check02\" name=\"check2\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_03\">가입한 보험의 보장에 대해서 충분히 알고 있다.</p></td>
<td><input type=\"radio\" id=\"check03\" name=\"check3\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check03\" name=\"check3\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_04\">갱신 비갱신형이 무슨 뜻인지 잘 알고 있다.</p></td>
<td><input type=\"radio\" id=\"check04\" name=\"check4\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check04\" name=\"check4\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_05\">은퇴후 노후를 위한 연금보험,연금저축을 가입했다.</p></td>
<td><input type=\"radio\" id=\"check05\" name=\"check5\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check05\" name=\"check5\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_06\">보험료가 부담되어 리모델링을 생각해 본 적이 있다.</p></td>
<td><input type=\"radio\" id=\"check06\" name=\"check6\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check06\" name=\"check6\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_07\">보험 비교사이트에 상담을 받아본 적이 있다.</p></td>
<td><input type=\"radio\" id=\"check07\" name=\"check7\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check07\" name=\"check7\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_08\">필요에 맞게 보험종목을 쪼개서 가입할 생각이다.</p></td>
<td><input type=\"radio\" id=\"check08\" name=\"check8\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check08\" name=\"check8\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_09\">생명보험, 손해보험 차이를 알고 있다.</p></td>
<td><input type=\"radio\" id=\"check09\" name=\"check9\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check09\" name=\"check9\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
<tr>
<td><p class=\"my_c_10\">지인의 권유보단 비교하여 가입하는 것이 알맞다.</p></td>
<td><input type=\"radio\" id=\"check10\" name=\"check10\" value=\"Y\">
<label for=\"gen\"><span class=\"margin_txt01\">YES</span></label>
<input type=\"radio\" id=\"check10\" name=\"check10\" value=\"N\">
<label for=\"women\"><span class=\"margin_txt01\">NO</span></label></td>
</tr>
</table>
<!--<a class=\"my_f_btn\" href=\"my_result_a.php\">--><a class=\"my_f_btn\" href=\"javascript:checkcounter(this);\"><img src=\"../img/my_insu/my_insu_btn.jpg\" title=\"나의보험 진단하기\"></a>
</form>
- 이전글html 포커스이동 20.02.21
- 다음글자바스크립트 정규식 20.02.21
댓글목록
등록된 댓글이 없습니다.