2012-12-06 4 views
0

답변을 수집하는 데 퀴즈로 사용되는 양식이 있으며 질문 수가 가변적이므로 양식이 동적으로 생성됩니다. for에 대한 라디오 버튼 그룹의 수를 계산할 수 있기를 원하는 경우 a) 데이터베이스에서 선택된 답변을 저장할 수 있도록 체크 한 위치와 b) 수집 할 수있는 위치를 결정할 수 있습니다. jQuery에서이 작업을 시도해보고 VBScript로 전달해야합니까? 아니면 VBScript에서 프로그래밍 방식으로 완료 할 수 있습니까? 는 참고로, 여기에 예를 들어 양식에 대해 생성 된 HTML이다 :VBScript는 양식의 특정 요소를 계산합니다.

<form id="vms_quiz" method="post"> 
<h2>Sustainable Infrastructure Quiz 1</h2> 
<p>Phasellus ultrices nulla quis nibh. Quisque a lectus. Donec consectetuer ligula vulputate sem tristique cursus. Nam nulla quam, gravida non, commodo a, sodales sit amet, nisi.</p> 
<!-- START QUESTION GROUP: Question #1 --> 
<h2>Question #1</h2> 
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> 
<label> 
    <input type="radio" name="Q_1" value="0" id="Q1C_1" akey="0" checked="false"> 
    Who</label> 
<label> 
    <input type="radio" name="Q_1" value="0" id="Q1C_2" akey="0" checked="false"> 
    What</label> 
<label> 
    <input type="radio" name="Q_1" value="1" id="Q1C_3" akey="1" checked="false"> 
    Where</label> 
<label> 
    <input type="radio" name="Q_1" value="0" id="Q1C_4" akey="0" checked="false"> 
    When</label> 
<label> 
    <input type="radio" name="Q_1" value="0" id="Q1C_5" akey="0" checked="false"> 
    Why</label> 
<!-- START QUESTION GROUP: Question #2 --> 
<h2>Question #2</h2> 
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> 
<label> 
    <input type="radio" name="Q_2" value="0" id="Q2C_6" akey="0" checked="false"> 
    Who</label> 
<label> 
    <input type="radio" name="Q_2" value="0" id="Q2C_7" akey="0" checked="false"> 
    What</label> 
<label> 
    <input type="radio" name="Q_2" value="1" id="Q2C_8" akey="1" checked="false"> 
    Where</label> 
<label> 
    <input type="radio" name="Q_2" value="0" id="Q2C_9" akey="0" checked="false"> 
    When</label> 
<label> 
    <input type="radio" name="Q_2" value="0" id="Q2C_10" akey="0" checked="false"> 
    Why</label> 
<!-- START QUESTION GROUP: Question #3 --> 
<h2>Question #3</h2> 
<p>Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed.</p> 
<label> 
    <input type="radio" name="Q_3" value="0" id="Q3C_11" akey="0" checked="false"> 
    Who</label> 
<label> 
    <input type="radio" name="Q_3" value="0" id="Q3C_12" akey="0" checked="false"> 
    What</label> 
<label> 
    <input type="radio" name="Q_3" value="1" id="Q3C_13" akey="1" checked="false"> 
    Where</label> 
<label> 
    <input type="radio" name="Q_3" value="0" id="Q3C_14" akey="0" checked="false"> 
    When</label> 
<label> 
    <input type="radio" name="Q_3" value="0" id="Q3C_15" akey="0" checked="false"> 
    Why</label> 
<input name="vms_quizID" type="hidden" value="1"> 
<input name="vms_videoID" type="hidden" value="1"> 
<div class="frm_div"> 
    <input id="btn_quiz_check_answers" name="btn_quiz_check_answers" type="submit" value="Check Answers"> 
</div> 

답변

1

클라이언트 측 VBScript를 인터넷 익스플로러에서만 사용할 수 있습니다. 자바 스크립트 (jQuery 자바 스크립트)를 사용해야합니다.

+0

나는 내가 원했던 대답을 유지하기위한 배열을 생각해 냈습니다. 클라이언트 측 VBScript에 대한 정보를 보내 주셔서 감사합니다. – stephmoreland

관련 문제