enquete_sp.vm 8.78 KB
Newer Older
1 2 3 4 5 6 7 8
<script language="javascript" type="text/javascript" charset="utf-8">
        $(function() {
                $("input[type=radio], input[type=checkbox], input[type=select]").click(function () {
                        $(this).focus();
                });
        });
</script>

Kim Gyeongeun committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
<div class="bg_blue">
$tools.getMsg("errorheader")
			####質問開始######
##$questionFor開始
#set($questionIndex = 0)
			#foreach($question  in  $!enqueteForm.questionList)
			#set($questionIndex = $velocityCount)
					<!-- 質問NO //-->
					Q$!question.questionNo
					<!-- 必須有無 //-->
					#if($!question.requiredFlg == "1")
					<font color="red">&nbsp;*&nbsp;</font>
					#end
					<!-- 質問項目 //-->
					$!question.questionName 
					#if($question.question != "")
						<BR> $!question.question
					#end
					
							<table width="100%" border="0">
								<tr>

								##<!-- 質問の表示列項目数を求める -->
								#if($!question.colNum)
									#set($questionColNum = $!question.colNum)
								#else
									#set($questionColNum = 1)
								#end

								#set($tdWidthPercent = (100/$questionColNum))

								##<!-- ○○番目カラム変数 -->
								#set($colNum = 0)

						##<!-- 2:SELECTMENU answer.answerNo値を値にする。-->
							#if($!question.controlId == "2")
							<td width="$tdWidthPercent%" valign = "top" >
								#set($answerIdValueName = "questionList[$questionIndex].answerList[0].answerIdValue")
47
								 <select name="$answerIdValueName" class="#he($!question.questionId) #he($!answer.answerId)" #if($!question.questionInitDisable == "1") disabled #end>
Kim Gyeongeun committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
										#foreach($selectAnswer in $question.answerList)
						   					 <option value="$!selectAnswer.answerId" #if($enqueteForm.initCount =="2" && $!selectAnswer.answerId == $!selectAnswer.answerIdValue) selected #elseif($!selectAnswer.defaultFlg == "1" && $enqueteForm.initCount!="2") selected    #end >$!escape.html($!selectAnswer.answer)</option>
						   				#end
								</select>
							</td></tr>
							</table>
							<font class="error">$!tools.getMsg("$!question.enqueteId.toString(),$!question.questionId.toString()")</font>
							<br>
							</td>
						#else

								#foreach($answer in $question.answerList)
								    #set($colNum = $colNum + 1)

									#set($answerIdName = "questionList$!{questionIndex}_answerList$!{velocityCount}_answerIdValue")
									#set($answerIdValueName = "questionList[$questionIndex].answerList[$velocityCount].answerIdValue")
									#set($answerIdValueRadioName = "questionList[$questionIndex].answerList[0].answerIdValue")
									#set($answerValue = "questionList[$questionIndex].answerList[$velocityCount].answerValue")

										##<!-- colSpan変数 -->
										#set($colSpan = 1)

										##<!-- 最後のカラムの場合、不足ColSpan数を計算する。 -->
										#if($question.answerList.size() == $velocityCount+1)
												#set($colSpan = $questionColNum - $colNum + 1)
										#end

											<!-- 0:RADIO インデクスを値にする。 -->
											#if($!question.controlId == "0")

												#set($answerId ="$!answerIdValueRadioName"+"$velocityCount")
												<div data-role="fieldcontain">
80
													<input type="radio" class="#he($!question.questionId) #he($!answer.answerId)" name="$!answerIdValueRadioName" id=$answerId value="$velocityCount"
Kim Gyeongeun committed
81
													#if($!answer.answerIdValue ==  $velocityCount.toString() && $enqueteForm.initCount =="2") checked #{end}
82
													 #if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end
83
													 #if($!question.questionInitDisable == "1") disabled #end>
Kim Gyeongeun committed
84 85 86 87 88 89
													<label for=$answerId>$!answer.answer</label>
										 		</div>

												##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) -->
												#if($!answer.freeTextFlg == 1 || $!answer.freeTextFlg == 2)
											 		<div data-role="fieldcontain">
90
											 		<input type="text" class="#he($!question.questionId) #he($!answer.answerId)_ft" id="$answerValue" name="$answerValue" size="$!answer.freeTextColWidth" value="$!escape.html($!answer.answerValue)" #if($!question.questionInitDisable == "1") disabled #end/>
Kim Gyeongeun committed
91 92 93 94 95 96 97 98 99
													<label for=$answerValue class="ui-hidden-accessible"></label>
											 		</div>
												#end

											##<!-- 1:CHECKBOX answer.answerNo値を値にする。-->
											#elseif($!question.controlId == "1")

												#set($answerId ="$!answerIdValueName"+"$velocityCount")
										 		<div data-role="fieldcontain">
100 101
												 <input type="checkbox" class="#he($!question.questionId) #he($!answer.answerId)" id=$answerId name="$answerIdValueName"  value="$!escape.html($!answer.answerNo)" #if($answer.answerIdValue != "" && $enqueteForm.initCount =="2") checked #end
								 															#if($!answer.defaultFlg == 1 && $enqueteForm.initCount =="1") checked #end
102
								 															#if($!question.questionInitDisable == "1") disabled #end>
103
												<label for=$answerId id="#he($!answer.answerId)">$!answer.answer</label>
Kim Gyeongeun committed
104 105 106 107 108
										 		</div>

												##<!-- 自由入力欄。freeTextFlg=1(あり)、2(必須) -->
												#if($!answer.freeTextFlg == 1 || $!answer.freeTextFlg == 2)
													<div data-role="fieldcontain">
109
														<input type="text" class="#he($!question.questionId) #he($!answer.answerId)_ft" id="$answerValue" name="$answerValue" size="$!answer.freeTextColWidth"  value="$!escape.html($!answer.answerValue)" #if($!question.questionInitDisable == "1") disabled #end/>
Kim Gyeongeun committed
110 111 112 113 114 115 116 117 118
														<label for=$answerValue class="ui-hidden-accessible"></label>
													</div>
												 #end

										    ##<!-- 2:SELECTMENU answer.answerNo値を値にする。-->
											#elseif($!question.controlId == "2")

												#if($velocityCount == 0)
													<div data-role="fieldcontain">
119
														<select name="$answerIdValueName" class="#he($!question.questionId) #he($!answer.answerId)" #if($!question.questionInitDisable == "1") disabled #end>
Kim Gyeongeun committed
120 121 122 123 124 125 126 127 128 129
															#foreach($selectAnswer in $question.answerList)
										   					    <option value="$!selectAnswer.answerId" #if($!selectAnswer.defaultFlg == "1") selected #end >$!selectAnswer.answer</option>
											   				#end
														</select>
													</div>
												#end

											##<!-- 3:TEXTAREA ユーザー入力値を値にする。-->
											#elseif($!question.controlId == "3")
										 		<div data-role="fieldcontain">
130
												<textArea type="text" class="#he($!question.questionId) #he($!answer.answerId)" name="$answerIdValueName" cols="$!question.dispWitdth" rows="$!question.rowCount" #if($!question.questionInitDisable == "1") disabled #end>$!answer.answerIdValue</textarea>
Kim Gyeongeun committed
131 132 133 134
										 		</div>
											##<!-- 4:TEXTFIELD ユーザー入力値を値にする。-->
											#elseif($!question.controlId == "4")
										 		<div data-role="fieldcontain">
135
												<input type="text" class="#he($!question.questionId) #he($!answer.answerId)" id="$answerIdValueName" name="$answerIdValueName" value="$!escape.html($!answer.answerIdValue)" size="$!question.dispWitdth" #if($!question.questionInitDisable == "1") disabled #end/>
Kim Gyeongeun committed
136 137 138 139 140
												<label for=$answerIdValueName class="ui-hidden-accessible"></label>
										 		</div>
											##<!-- 5:日付入力 ユーザー入力値を値にする。-->
											#elseif($!question.controlId == "5")
										 		<div data-role="fieldcontain">
141
												<input type="date" class="#he($!question.questionId) #he($!answer.answerId)" id="$answerIdName" name="$answerValue" value="$!escape.html($!answer.answerValue)" #if($!question.questionInitDisable == "1") disabled #end/>
Kim Gyeongeun committed
142 143 144 145 146
												<label for=$answerIdName class="ui-hidden-accessible"></label>
												<input type="hidden" name="$answerIdValueName" value="$!answer.answerId" />
										 		</div>
											 #elseif($!question.controlId == "6")
												<div data-role="fieldcontain">
147
								 				<select name="$answerIdValueName" class="#he($!question.questionId) #he($!answer.answerId)" #if($!question.questionInitDisable == "1") disabled #end>
Kim Gyeongeun committed
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
								 				<option value="" >下記より選択してください</option>
												#foreach($pecent1 in $enqueteForm.organizationListFor1Percent)
													<option value="$!pecent1.organizationId" #if($!answer.answerIdValue ==  $!pecent1.organizationId) selected #end>$!{pecent1.organizationNo} : $!escape.html($!{pecent1.organizationName})</option>
												#end
												</select>
												</div>
											#end
								#end
								</tr>
							</table>

							<font class="error">$!tools.getMsg("$!question.enqueteId.toString(),$!question.questionId.toString()") $!tools.getMsg("$!question.enqueteId.toString(),$!question.questionId.toString()_1") $!tools.getMsg("$!question.enqueteId.toString(),$!question.questionId.toString()_2")</font>
							<br>
			#end
			#end  ##<!-- 2:SELECTMENU 終了-->
			####質問終了######
</div>