Commit 7e13d958 by Kim Gyeongeun

#56952 設問設定機能追加(アンケート区分別、グレーアウトが効かない問題修正)

#56950 アンケートの設問コピー機能(条件付必須項目がコピーされない問題修正)
parent 18164fdf
...@@ -448,7 +448,6 @@ public class EnqueteRegistAction extends AbstractAction { ...@@ -448,7 +448,6 @@ public class EnqueteRegistAction extends AbstractAction {
@Execute(validator = true ,validate="questionEditValidate",input="/admin/enquete/questionEdit.html") @Execute(validator = true ,validate="questionEditValidate",input="/admin/enquete/questionEdit.html")
public String questionEditConfirm() { public String questionEditConfirm() {
TokenProcessor.getInstance().saveToken(request); TokenProcessor.getInstance().saveToken(request);
enqueteRegistForm.questionList = questionService.findAllOrderByEnqueteId(enqueteRegistForm.eid); enqueteRegistForm.questionList = questionService.findAllOrderByEnqueteId(enqueteRegistForm.eid);
if(enqueteRegistForm.questionList.size() >= 30 &&(StringUtil.isBlank(enqueteRegistForm.qid) || StringUtil.equals("0", enqueteRegistForm.qid))){//設問が30件以上の場合は追加登録できない。 if(enqueteRegistForm.questionList.size() >= 30 &&(StringUtil.isBlank(enqueteRegistForm.qid) || StringUtil.equals("0", enqueteRegistForm.qid))){//設問が30件以上の場合は追加登録できない。
addErrorMessage("QuestionCountError", "question.maxCoutError"); addErrorMessage("QuestionCountError", "question.maxCoutError");
...@@ -459,7 +458,7 @@ public class EnqueteRegistAction extends AbstractAction { ...@@ -459,7 +458,7 @@ public class EnqueteRegistAction extends AbstractAction {
addErrorMessage("isSendMailAddress", "question.alreadyExistMailQuestion"); addErrorMessage("isSendMailAddress", "question.alreadyExistMailQuestion");
return "/admin/enquete/questionEdit.html"; return "/admin/enquete/questionEdit.html";
} }
enqueteRegistForm.enquete = enqueteService.findById(Integer.parseInt(enqueteRegistForm.eid)); enqueteRegistForm.enquete = enqueteService.findById(Integer.parseInt(enqueteRegistForm.eid));
String condAnswerStr=""; String condAnswerStr="";
......
...@@ -245,11 +245,15 @@ public class EnqueteRegistForm { ...@@ -245,11 +245,15 @@ public class EnqueteRegistForm {
errors.add("radioAdminText"+j, new ActionMessage("labels.answer"/*"回答文字列を入力してください。"*/)); errors.add("radioAdminText"+j, new ActionMessage("labels.answer"/*"回答文字列を入力してください。"*/));
} }
} }
if (CollectionUtils.isNotEmpty(condRequiredQuestionAnswerList) && StringUtil.isNotBlank(radioDefault)) {
errors.add("radioAdminText"+(radioAdminText.size()-1), new ActionMessage("question.check.default.condRequiredAnswer"/*"条件付必須項目を設定した場合、デフォルト選択肢は選択できません。"*/));
}
if(StringUtil.equals(radioFreeAnserUse, "1") && Integer.parseInt(radioFreeNo) > j ){ if(StringUtil.equals(radioFreeAnserUse, "1") && Integer.parseInt(radioFreeNo) > j ){
errors.add("radioFreeNoError", new ActionMessage("labels.freeMax","該当選択肢"/*"最大選択数は選択肢の数以下にしてください。"*/)); errors.add("radioFreeNoError", new ActionMessage("labels.freeMax","該当選択肢"/*"最大選択数は選択肢の数以下にしてください。"*/));
} }
break; break;
case 1: case 1:
/**チェックボックス*/ /**チェックボックス*/
...@@ -294,6 +298,10 @@ public class EnqueteRegistForm { ...@@ -294,6 +298,10 @@ public class EnqueteRegistForm {
errors.add("checkAdminText"+(i-1), new ActionMessage("labels.textMaxLength1up","最大選択数","1以上選択"/*"最大入力文字数を入力してください。"*/)); errors.add("checkAdminText"+(i-1), new ActionMessage("labels.textMaxLength1up","最大選択数","1以上選択"/*"最大入力文字数を入力してください。"*/));
} }
if (CollectionUtils.isNotEmpty(condRequiredQuestionAnswerList) && checkDefault.contains("1")) {
errors.add("checkAdminText"+(i-1), new ActionMessage("question.check.default.condRequiredAnswer"/*"条件付必須項目を設定した場合、デフォルト選択肢は選択できません。"*/));
}
break; break;
case 2: case 2:
...@@ -321,6 +329,10 @@ public class EnqueteRegistForm { ...@@ -321,6 +329,10 @@ public class EnqueteRegistForm {
errors.add("selectDefault", new ActionMessage("labels.defaultSelect"/*"デフォルト値が選択候補にありません。"*/)); errors.add("selectDefault", new ActionMessage("labels.defaultSelect"/*"デフォルト値が選択候補にありません。"*/));
} }
} }
if (CollectionUtils.isNotEmpty(condRequiredQuestionAnswerList) && StringUtil.isNotBlank(selectDefault)) {
errors.add("selectCand", new ActionMessage("question.check.default.condRequiredAnswer"/*"条件付必須項目を設定した場合、デフォルト選択肢は選択できません。"*/));
}
break; break;
case 3: case 3:
......
...@@ -1324,6 +1324,4 @@ public class EnqueteService extends AbstractService<Enquete> { ...@@ -1324,6 +1324,4 @@ public class EnqueteService extends AbstractService<Enquete> {
} }
return result; return result;
} }
} }
\ No newline at end of file
...@@ -187,7 +187,7 @@ public class MemberService extends AbstractService<Member> { ...@@ -187,7 +187,7 @@ public class MemberService extends AbstractService<Member> {
passwordMailSendService.insertPasswordMailSend(passwordMailSend,"REGIST"); passwordMailSendService.insertPasswordMailSend(passwordMailSend,"REGIST");
//メール送信 //メール送信
MailUtil.send(email,title, body.toString()); //MailUtil.send(email,title, body.toString());
} }
return retValue; return retValue;
......
...@@ -4,6 +4,7 @@ import java.util.ArrayList; ...@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -323,37 +324,47 @@ public class QuestionService extends AbstractService<Question> { ...@@ -323,37 +324,47 @@ public class QuestionService extends AbstractService<Question> {
* @return * @return
*/ */
public void setQuestionDisable(List<Question> questionList) { public void setQuestionDisable(List<Question> questionList) {
HashMap<Integer, Integer> requiredQuestionInfo = new HashMap<Integer, Integer>(); Map<Integer, Integer> requiredAnswerIdMap = new HashMap<Integer, Integer>();
List<Integer> defaultAnswerIdList = new ArrayList<Integer>(); Map<Integer, Integer> defaultAnswerIdMap = new HashMap<Integer, Integer>();
//初期表示情報セット
for (Question question : questionList) { for (Question question : questionList) {
if (question.controlId.equals(SinaburoConstant.ControlType.TEXTAREA)
|| question.controlId.equals(SinaburoConstant.ControlType.TEXTFIELD)
|| question.controlId.equals(SinaburoConstant.ControlType.HIDUKE)) {continue;}
for (Answer answer : question.answerList) { for (Answer answer : question.answerList) {
if (question.condRequiredQuestionNo != null /*&& question.condRequiredQuestionNo == 0*/ && requiredQuestionInfo.get(answer.answerId) == null) { if (question.condRequiredQuestionNo != null && requiredAnswerIdMap.get(answer.answerId) == null) {
if (answer.defaultFlg == 0 && StringUtil.isBlank(answer.answerIdValue)) {continue;} if (answer.defaultFlg == 0 && StringUtil.isBlank(answer.answerIdValue)) {continue;}
//条件付回答設定の選択した値 //条件付回答設定の選択した値
if (answer.defaultFlg == 0 && StringUtil.isNotBlank(answer.answerIdValue)) { if ((question.controlId.equals(SinaburoConstant.ControlType.RADIO)
requiredQuestionInfo.put(answer.answerId, 1); || question.controlId.equals(SinaburoConstant.ControlType.SELECTMENU))
&& answer.defaultFlg == 0 && StringUtil.isNotBlank(answer.answerIdValue)) {
requiredAnswerIdMap.put(answer.answerId, question.controlId);
break;
}
if (question.controlId.equals(SinaburoConstant.ControlType.CHECKBOX)
&& answer.defaultFlg == 0 && StringUtil.isNotBlank(answer.answerIdValue)) {
requiredAnswerIdMap.put(answer.answerId, question.controlId);
} }
//条件付回答設定のデフォルト値 //条件付回答設定のデフォルト値
if (answer.defaultFlg == 1) { if (answer.defaultFlg == 1) {
defaultAnswerIdList.add(answer.answerId); defaultAnswerIdMap.put(answer.answerId, question.controlId);
} }
} }
} }
} }
//条件付回答設定IDがない場合、デフォルト値の回答IDをセット for (Map.Entry<Integer, Integer> entry : defaultAnswerIdMap.entrySet()) {
if (requiredQuestionInfo.isEmpty() && CollectionUtils.isNotEmpty(defaultAnswerIdList)) { //デフォルト値は存在、選択値はなし
for (Integer defaultAnswerId : defaultAnswerIdList) { if (!requiredAnswerIdMap.containsValue(entry.getValue())) {
requiredQuestionInfo.put(defaultAnswerId, 1); requiredAnswerIdMap.put(entry.getKey(), entry.getValue());
} }
} }
for (Question question : questionList) { for (Question question : questionList) {
//条件付必須チェック(初期画面表示・非表示セット) //条件付必須チェック(初期画面表示・非表示セット)
if (question.condRequiredQuestionNo != null && question.condRequiredQuestionNo != 0 if (question.condRequiredQuestionNo != null && question.condRequiredQuestionNo != 0
&& StringUtils.isNotBlank(question.condRequiredAnswer)) { && StringUtils.isNotBlank(question.condRequiredAnswer)) {
List<String> requiredAnswerIdList = new ArrayList<String>(Arrays.asList(question.condRequiredAnswer.split(","))); List<String> requiredAnswerIdList = new ArrayList<String>(Arrays.asList(question.condRequiredAnswer.split(",")));
for (String requiredAnswerId : requiredAnswerIdList) { for (String requiredAnswerId : requiredAnswerIdList) {
if (requiredQuestionInfo.get(IntegerConversionUtil.toInteger(requiredAnswerId)) == null) { if (requiredAnswerIdMap.get(IntegerConversionUtil.toInteger(requiredAnswerId)) == null) {
question.questionInitDisable = SinaburoConstant.initDisable.YES; question.questionInitDisable = SinaburoConstant.initDisable.YES;
} else { } else {
question.questionInitDisable = SinaburoConstant.initDisable.NO; question.questionInitDisable = SinaburoConstant.initDisable.NO;
...@@ -366,8 +377,10 @@ public class QuestionService extends AbstractService<Question> { ...@@ -366,8 +377,10 @@ public class QuestionService extends AbstractService<Question> {
for (Question question : questionList) { for (Question question : questionList) {
if (question.questionInitDisable == SinaburoConstant.initDisable.YES) { if (question.questionInitDisable == SinaburoConstant.initDisable.YES) {
for (Answer answer : question.answerList) { for (Answer answer : question.answerList) {
answer.answerIdValue = ""; if (answer.defaultFlg == 0) {
answer.answerValue = ""; answer.answerIdValue = "";
answer.answerValue = "";
}
} }
} }
} }
......
...@@ -263,6 +263,7 @@ withDrow.mail.body=\u9000\u4f1a\u624b\u7d9a\u304d\u304c\u5b8c\u4e86\u3057\u307e\ ...@@ -263,6 +263,7 @@ withDrow.mail.body=\u9000\u4f1a\u624b\u7d9a\u304d\u304c\u5b8c\u4e86\u3057\u307e\
question.maxCoutError=\u8a2d\u554f\u6570\u304c30\u3092\u8d85\u3048\u3066\u3044\u307e\u3059\u3002 question.maxCoutError=\u8a2d\u554f\u6570\u304c30\u3092\u8d85\u3048\u3066\u3044\u307e\u3059\u3002
question.alreadyExistMailQuestion=\u3059\u3067\u306b\u9001\u4fe1\u7528\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u8a2d\u554f\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u3002 question.alreadyExistMailQuestion=\u3059\u3067\u306b\u9001\u4fe1\u7528\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u8a2d\u554f\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u3002
question.check.default.condRequiredAnswer=\u6761\u4ef6\u4ed8\u5fc5\u9808\u9805\u76ee\u3092\u8a2d\u5b9a\u3057\u305f\u5834\u5408\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u9078\u629e\u80a2\u306f\u9078\u629e\u3067\u304d\u307e\u305b\u3093\u3002
adminRegist.repetLoginId=\u65e2\u306b\u767b\u9332\u6e08\u307f\u306e\u30ed\u30b0\u30a4\u30f3ID\u3067\u3059\u3002 adminRegist.repetLoginId=\u65e2\u306b\u767b\u9332\u6e08\u307f\u306e\u30ed\u30b0\u30a4\u30f3ID\u3067\u3059\u3002
......
...@@ -539,7 +539,7 @@ window.scroll(500,500); ...@@ -539,7 +539,7 @@ window.scroll(500,500);
#if($tools.isNotEmpty($checkAsnwerIdList)) #if($tools.isNotEmpty($checkAsnwerIdList))
<input type="hidden" name="checkAsnwerIdList[$velocityCount]" value="$list.get($checkAsnwerIdList,$velocityCount)"/> <input type="hidden" name="checkAsnwerIdList[$velocityCount]" value="$list.get($checkAsnwerIdList,$velocityCount)"/>
#end #end
</BR> $!tools.getMsg("checkAdminText$!{velocityCount}") <BR> $!tools.getMsg("checkAdminText$!{velocityCount}")
</div> </div>
</div> </div>
#end #end
......
<!------------------------------------------------------QUESTION DISABLE START -------------------------------------------------->
#foreach($question in $!enqueteForm.questionList)
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
function radioOrCheckboxEvent(id, isDisable) {
if (isDisable) {
$("#" + id).attr("checked", false);
$("#" + id).attr("disabled", true);
$("#" + id).trigger("click");
} else {
$("#" + id).attr("disabled", false);
}
}
function dateEvent(id, isDisable) {
if (isDisable) {
$("." + id).val("");
$("." + id).attr("disabled", true);
$("." + id).next().hide();
} else {
$("." + id).attr("disabled", false);
$("." + id).next().show();
}
}
function etcEvent(id, isDisable) {
if (isDisable) {
$("#" + id).val("");
$("#" + id).attr("disabled", true);
} else {
$("#" + id).attr("disabled", false);
}
}
$(function() {
//条件付必須チェック(セレクトメニュー)
$('select').change(function() {
var selectQuestionId = $(this).attr("id");
var selectAnswerId = $(this).val();
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == selectQuestionId) {
//グレーアウト対象
if ("${question.condRequiredAnswer}".split(",").indexOf(selectAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
radioOrCheckboxEvent("${answer.answerId}", true);
} else if ( "${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", true);
} else {
dateEvent("${question.questionId}", true);
}
}
//グレーアウト解除
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
radioOrCheckboxEvent("${answer.answerId}", false);
} else if ("${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", false);
} else {
dateEvent("${question.questionId}", false);
}
}
}
}
});
//条件付必須チェック(ラジオボタン、チェックボックス)
$("input[type=radio], input[type=checkbox]").click(function () {
var thisQuestionId = $(this).attr("class");
var thisAnswerId = $(this).attr("id");
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
//グレーアウト対象
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ($(this).attr("type") == "radio"
&& ("${question.controlId}" == "0" || "${question.controlId}" == "1")) {
if ($(this).is(":checked")) {
radioOrCheckboxEvent("${answer.answerId}", true);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
radioOrCheckboxEvent("${answer.answerId}", true);
}
}
} else if ( "${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
$("#${question.questionId}").val("").trigger("change");
}
if ($(this).attr("type") == "radio") {
if ($(this).is(":checked")) {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", true);
} else {
dateEvent("${question.questionId}", true);
}
}
} else {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", false);
} else {
dateEvent("${question.questionId}", false);
}
}
}
}
//グレーアウト解除
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
if ($(this).is(":checked")) {
radioOrCheckboxEvent("${answer.answerId}", false);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
radioOrCheckboxEvent("${answer.answerId}", true);
}
}
} else if ("${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
$("#${question.questionId}").val("").trigger("change");
}
if ($(this).is(":checked")) {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", false);
} else {
dateEvent("${question.questionId}", false);
}
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", true);
} else {
dateEvent("${question.questionId}", true);
}
}
}
}
}
}
});
});
// -->
</script>
#end
#end
<!------------------------------------------------------QUESTION DISABLE END-------------------------------------------------->
\ No newline at end of file
<!------------------------------------------------------QUESTION DISABLE START -------------------------------------------------->
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
window.onload = function () {
$("input[type=text], input[type=date], textArea[type=text]").each(function(){
if ($(this).prop("disabled")) {
$(this).val("");
$(this).textinput().textinput("disable");
if ($(this).prop("type") == "date") {
$(this).next().hide();
}
}
});
}
// -->
</script>
#foreach($question in $!enqueteForm.questionList)
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
function radioOrCheckboxEvent(id, isDisable) {
if (isDisable) {
$("." + id).prop("checked", false);
$("." + id).checkboxradio('refresh').checkboxradio('disable');
$("." + id).trigger("click");
} else {
$("." + id).checkboxradio("enable").checkboxradio('refresh');
}
}
function dateEvent(id, isDisable) {
if (isDisable) {
$("." + id).val("");
$("." + id).textinput("disable");
$("." + id).next().hide();
} else {
$("." + id).textinput("enable");
$("." + id).next().show();
}
}
function selectEvent(id, isDisable) {
if (isDisable) {
$("." + id).selectmenu("refresh").selectmenu("disable");
$("." + id).val("").trigger("change");
} else {
$("." + id).selectmenu("enable");
}
}
function textEvent(id, isDisable) {
if (isDisable) {
$("." + id).val("");
$("." + id).textinput("disable");
} else {
$("." + id).textinput("enable");
}
}
$(function() {
//条件付必須チェック(セレクトメニュー)
$('select').change(function() {
var selectQuestionId = $(this).attr("class");
var selectAnswerId = $(this).val();
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == selectQuestionId) {
//グレーアウト対象
if ("${question.condRequiredAnswer}".split(",").indexOf(selectAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
radioOrCheckboxEvent("${answer.answerId}", true);
} else if ( "${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
selectEvent("${question.questionId}", true);
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
textEvent("${question.questionId}", true);
} else if ("${question.controlId}" == "5") {
dateEvent("${question.questionId}", true);
}
}
//グレーアウト解除
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
radioOrCheckboxEvent("${answer.answerId}", false);
} else if ("${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
selectEvent("${question.questionId}", false);
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
textEvent("${question.questionId}", false);
} else if ("${question.controlId}" == "5") {
dateEvent("${question.questionId}", false);
}
}
}
}
});
//条件付必須チェック(ラジオボタン、チェックボックス)
$("input[type=radio], input[type=checkbox]").click(function () {
var thisQuestionId = $(this).attr("class").split(" ")[0];
var thisAnswerId = $(this).attr("class").split(" ")[1];
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
//グレーアウト対象
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ($(this).attr("type") == "radio"
&& ("${question.controlId}" == "0" || "${question.controlId}" == "1")) {
if ($(this).is(":checked")) {
radioOrCheckboxEvent("${answer.answerId}", true);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
radioOrCheckboxEvent("${answer.answerId}", true);
}
}
} else if ( "${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
$("." + "${question.questionId}").val("").trigger("change");
}
if ($(this).attr("type") == "radio") {
if ($(this).is(":checked")) {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
selectEvent("${question.questionId}", true);
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
textEvent("${question.questionId}", true);
} else if ("${question.controlId}" == "5") {
dateEvent("${question.questionId}", true);
}
}
} else {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
selectEvent("${question.questionId}", false);
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
textEvent("${question.questionId}", false);
} else if ("${question.controlId}" == "5") {
dateEvent("${question.questionId}", false);
}
}
}
}
//グレーアウト解除
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
if ($(this).is(":checked")) {
radioOrCheckboxEvent("${answer.answerId}", false);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
radioOrCheckboxEvent("${answer.answerId}", true);
}
}
} else if ("${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
$("." + "${question.questionId}").val("").trigger("change");
}
if ($(this).is(":checked")) {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
selectEvent("${question.questionId}", false);
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
textEvent("${question.questionId}", false);
} else if ("${question.controlId}" == "5") {
dateEvent("${question.questionId}", false);
}
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
if ("${question.controlId}" == "2" || "${question.controlId}" == "6") {
selectEvent("${question.questionId}", true);
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
textEvent("${question.questionId}", true);
} else if ("${question.controlId}" == "5") {
dateEvent("${question.questionId}", true);
}
}
}
}
}
}
});
});
// -->
</script>
#end
#end
<!------------------------------------------------------QUESTION DISABLE END-------------------------------------------------->
\ No newline at end of file
#set($title = "アンケート") #set($title = "アンケート")
<script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script>
#foreach($question in $!enqueteForm.questionList) #parse( "/WEB-INF/view/common/question_disable.vm" )
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
$(function() {
//条件付必須チェック
$("input[type=radio], input[type=checkbox], input[type=select]").click(function () {
var thisQuestionId = $(this).attr("class");
var thisAnswerId = $(this).attr("id");
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("checked", false);
$("#${answer.answerId}").attr("disabled", true);
} else if ("${question.controlId}" == "2") {
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").val("");
$("#${question.questionId}").attr("disabled", true);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").val("");
$(".${question.questionId}").attr("disabled", true);
$(".${question.questionId}").next().hide();
}
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("disabled", false);
} else if ("${question.controlId}" == "2") {
if ($(this).is(":checked")) {
$("#${question.questionId}").attr("disabled", false);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
$("#${question.questionId}").val('');
$("#${question.questionId}").attr("disabled", true);
}
}
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").attr("disabled", false);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").attr("disabled", false);
$(".${question.questionId}").next().show();
}
}
}
});
});
// -->
</script>
#end
#end
<!-- preHeader --> <!-- preHeader -->
#parse( "/WEB-INF/view/common/preHeader_mb.vm" ) #parse( "/WEB-INF/view/common/preHeader_mb.vm" )
<body style="font-family: monospace; width: 240px; border: 2px solid black;"> <body style="font-family: monospace; width: 240px; border: 2px solid black;">
......
#set($title = "アンケート") #set($title = "アンケート")
<script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script>
#foreach($question in $!enqueteForm.questionList) #parse( "/WEB-INF/view/common/question_disable.vm" )
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
$(function() {
//条件付必須チェック
$("input[type=radio], input[type=checkbox], input[type=select]").click(function () {
var thisQuestionId = $(this).attr("class");
var thisAnswerId = $(this).attr("id");
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("checked", false);
$("#${answer.answerId}").attr("disabled", true);
} else if ("${question.controlId}" == "2") {
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").val("");
$("#${question.questionId}").attr("disabled", true);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").val("");
$(".${question.questionId}").attr("disabled", true);
$(".${question.questionId}").next().hide();
}
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("disabled", false);
} else if ("${question.controlId}" == "2") {
if ($(this).is(":checked")) {
$("#${question.questionId}").attr("disabled", false);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
$("#${question.questionId}").val('');
$("#${question.questionId}").attr("disabled", true);
}
}
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").attr("disabled", false);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").attr("disabled", false);
$(".${question.questionId}").next().show();
}
}
}
});
});
// -->
</script>
#end
#end
<!-- preHeader --> <!-- preHeader -->
#parse( "/WEB-INF/view/common/preHeader_mb.vm" ) #parse( "/WEB-INF/view/common/preHeader_mb.vm" )
<body style="font-family: monospace; width: 240px; border: 2px solid black;"> <body style="font-family: monospace; width: 240px; border: 2px solid black;">
......
#set($title = "アンケート") #set($title = "アンケート")
<script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script>
#foreach($question in $!enqueteForm.questionList) #parse( "/WEB-INF/view/common/question_disable.vm" )
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
$(function() {
//条件付必須チェック
$("input[type=radio], input[type=checkbox], input[type=select]").click(function () {
var thisQuestionId = $(this).attr("class");
var thisAnswerId = $(this).attr("id");
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("checked", false);
$("#${answer.answerId}").attr("disabled", true);
} else if ("${question.controlId}" == "2") {
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").val("");
$("#${question.questionId}").attr("disabled", true);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").val("");
$(".${question.questionId}").attr("disabled", true);
$(".${question.questionId}").next().hide();
}
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("disabled", false);
} else if ("${question.controlId}" == "2") {
if ($(this).is(":checked")) {
$("#${question.questionId}").attr("disabled", false);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
$("#${question.questionId}").val('');
$("#${question.questionId}").attr("disabled", true);
}
}
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").attr("disabled", false);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").attr("disabled", false);
$(".${question.questionId}").next().show();
}
}
}
});
});
// -->
</script>
#end
#end
<!-- preHeader --> <!-- preHeader -->
#parse( "/WEB-INF/view/common/preHeader_mb.vm" ) #parse( "/WEB-INF/view/common/preHeader_mb.vm" )
<body style="font-family: monospace; width: 240px; border: 2px solid black;"> <body style="font-family: monospace; width: 240px; border: 2px solid black;">
......
#set($title = "アンケート回答") #set($title = "アンケート回答")
<script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script>
<script language="javascript" type="text/javascript" charset="utf-8"> #parse( "/WEB-INF/view/common/question_disable_sp.vm" )
<!--
window.onload = function () {
$("input[type=text], input[type=date], textArea[type=text]").each(function(){
if ($(this).prop("disabled")) {
$(this).val("");
$(this).textinput().textinput("disable");
if ($(this).prop("type") == "date") {
$(this).next().hide();
}
}
});
}
// -->
</script>
#foreach($question in $!enqueteForm.questionList)
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
$(function() {
//条件付必須チェック
$("input[type=radio], input[type=checkbox], input[type=select]").click(function () {
var idArray = $(this).attr("class").split(" ");
var thisQuestionId = idArray[0];
var thisAnswerId = idArray[1];
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
var key;
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
key = "${answer.answerId}";
$("." + key).prop("checked", false);
$("." + key).checkboxradio('refresh').checkboxradio('disable');
} else if ("${question.controlId}" == "2") {
} else if ("${question.controlId}" == "6") {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).selectmenu("refresh").selectmenu("disable");
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).textinput("disable");
} else if ("${question.controlId}" == "5") {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).textinput("disable");
$("." + key).next().hide();
}
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
key = "${answer.answerId}";
$("." + key).checkboxradio("enable").checkboxradio('refresh');
} else if ("${question.controlId}" == "2") {
if ($(this).is(":checked")) {
key = "${question.questionId}";
$("." + key).selectmenu("enable");
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("." + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).selectmenu("refresh").selectmenu("disable");
}
}
} else if ("${question.controlId}" == "6") {
key = "${question.questionId}";
$("." + key).selectmenu("enable");
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
key = "${question.questionId}";
$("." + key).textinput("enable");
} else if ("${question.controlId}" == "5") {
key = "${question.questionId}";
$("." + key).textinput("enable");
$("." + key).next().show();
}
}
}
});
});
// -->
</script>
#end
#end
<!-- preHeader --> <!-- preHeader -->
#set($ajaxdisable = "1") #set($ajaxdisable = "1")
#parse( "/WEB-INF/view/common/preHeader_sp.vm" ) #parse( "/WEB-INF/view/common/preHeader_sp.vm" )
......
#set($title = "アンケート回答") #set($title = "アンケート回答")
<script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script>
<script language="javascript" type="text/javascript" charset="utf-8"> #parse( "/WEB-INF/view/common/question_disable_sp.vm" )
<!--
window.onload = function () {
$("input[type=text], input[type=date], textArea[type=text]").each(function(){
if ($(this).prop("disabled")) {
$(this).val("");
$(this).textinput().textinput("disable");
if ($(this).prop("type") == "date") {
$(this).next().hide();
}
}
});
}
// -->
</script>
#foreach($question in $!enqueteForm.questionList)
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
$(function() {
//条件付必須チェック
$("input[type=radio], input[type=checkbox], input[type=select]").click(function () {
var idArray = $(this).attr("class").split(" ");
var thisQuestionId = idArray[0];
var thisAnswerId = idArray[1];
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
var key;
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
key = "${answer.answerId}";
$("." + key).prop("checked", false);
$("." + key).checkboxradio('refresh').checkboxradio('disable');
} else if ("${question.controlId}" == "2") {
} else if ("${question.controlId}" == "6") {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).selectmenu("refresh").selectmenu("disable");
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).textinput("disable");
} else if ("${question.controlId}" == "5") {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).textinput("disable");
$("." + key).next().hide();
}
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
key = "${answer.answerId}";
$("." + key).checkboxradio('enable');
} else if ("${question.controlId}" == "2") {
if ($(this).is(":checked")) {
key = "${question.questionId}";
$("." + key).selectmenu("enable");
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("." + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).selectmenu("refresh").selectmenu("disable");
}
}
} else if ("${question.controlId}" == "6") {
key = "${question.questionId}";
$("." + key).selectmenu("enable");
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
key = "${question.questionId}";
$("." + key).textinput("enable");
} else if ("${question.controlId}" == "5") {
key = "${question.questionId}";
$("." + key).textinput("enable");
$("." + key).next().show();
}
}
}
});
});
// -->
</script>
#end
#end
<!-- preHeader --> <!-- preHeader -->
#set($ajaxdisable = "1") #set($ajaxdisable = "1")
#parse( "/WEB-INF/view/common/preHeader_sp.vm" ) #parse( "/WEB-INF/view/common/preHeader_sp.vm" )
......
#set($title = "アンケート回答") #set($title = "アンケート回答")
<script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="/em/js/jquery-1.3.1.min.js"></script>
<script language="javascript" type="text/javascript" charset="utf-8"> #parse( "/WEB-INF/view/common/question_disable_sp.vm" )
<!--
window.onload = function () {
$("input[type=text], input[type=date], textArea[type=text]").each(function(){
if ($(this).prop("disabled")) {
$(this).val("");
$(this).textinput().textinput("disable");
if ($(this).prop("type") == "date") {
$(this).next().hide();
}
}
});
}
// -->
</script>
#foreach($question in $!enqueteForm.questionList)
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
$(function() {
//条件付必須チェック
$("input[type=radio], input[type=checkbox], input[type=select]").click(function () {
var idArray = $(this).attr("class").split(" ");
var thisQuestionId = idArray[0];
var thisAnswerId = idArray[1];
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
var key;
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
key = "${answer.answerId}";
$("." + key).prop("checked", false);
$("." + key).checkboxradio('refresh').checkboxradio('disable');
} else if ("${question.controlId}" == "2") {
} else if ("${question.controlId}" == "6") {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).selectmenu("refresh").selectmenu("disable");
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).textinput("disable");
} else if ("${question.controlId}" == "5") {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).textinput("disable");
$("." + key).next().hide();
}
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
key = "${answer.answerId}";
$("." + key).checkboxradio('enable');
} else if ("${question.controlId}" == "2") {
if ($(this).is(":checked")) {
key = "${question.questionId}";
$("." + key).selectmenu("enable");
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("." + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
key = "${question.questionId}";
$("." + key).val("");
$("." + key).selectmenu("refresh").selectmenu("disable");
}
}
} else if ("${question.controlId}" == "6") {
key = "${question.questionId}";
$("." + key).selectmenu("enable");
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4") {
key = "${question.questionId}";
$("." + key).textinput("enable");
} else if ("${question.controlId}" == "5") {
key = "${question.questionId}";
$("." + key).textinput("enable");
$("." + key).next().show();
}
}
}
});
});
// -->
</script>
#end
#end
<!-- preHeader --> <!-- preHeader -->
#set($ajaxdisable = "1") #set($ajaxdisable = "1")
#parse( "/WEB-INF/view/common/preHeader_sp.vm" ) #parse( "/WEB-INF/view/common/preHeader_sp.vm" )
......
...@@ -24,197 +24,7 @@ $(function() { ...@@ -24,197 +24,7 @@ $(function() {
</script> </script>
#end #end
#end #end
#foreach($question in $!enqueteForm.questionList) #parse( "/WEB-INF/view/common/question_disable.vm" )
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
function radioOrCheckboxEvent(id, isDisable) {
$("#" + id).trigger("click");
if (isDisable) {
$("#" + id).attr("checked", false);
$("#" + id).attr("disabled", true);
} else {
$("#" + id).attr("disabled", false);
}
}
function dateEvent(id, isDisable) {
if (isDisable) {
$("." + id).val('');
$("." + id).attr("disabled", true);
$("." + id).next().hide();
} else {
$("." + id).attr("disabled", false);
$("." + id).next().show();
}
}
function etcEvent(id, isDisable) {
if (isDisable) {
$("#" + id).val('');
$("#" + id).attr("disabled", true);
} else {
$("#" + id).attr("disabled", false);
}
}
$(function() {
//条件付必須チェック(セレクトメニュー)
$('select').change(function() {
var selectQuestionId = $(this).attr("id");
var selectAnswerId = $(this).val();
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == selectQuestionId) {
//グレーアウト対象
if ("${question.condRequiredAnswer}".split(",").indexOf(selectAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
radioOrCheckboxEvent("${answer.answerId}", true);
} else if ( "${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", true);
} else {
dateEvent("${question.questionId}", true);
}
}
//グレーアウト解除
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
radioOrCheckboxEvent("${answer.answerId}", false);
} else if ("${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", false);
} else {
dateEvent("${question.questionId}", false);
}
}
}
}
});
//条件付必須チェック(ラジオボタン、チェックボックス)
$("input[type=radio], input[type=checkbox]").click(function () {
var thisQuestionId = $(this).attr("class");
var thisAnswerId = $(this).attr("id");
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
//グレーアウト対象
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ($(this).attr("type") == "radio"
&& ("${question.controlId}" == "0" || "${question.controlId}" == "1")) {
if ($(this).is(":checked")) {
radioOrCheckboxEvent("${answer.answerId}", true);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
radioOrCheckboxEvent("${answer.answerId}", true);
}
}
} else if ( "${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" == "2") {
$("#${question.questionId}").trigger("change");
}
if ($(this).attr("type") == "radio") {
if ($(this).is(":checked")) {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", true);
} else {
dateEvent("${question.questionId}", true);
}
}
} else {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", false);
} else {
dateEvent("${question.questionId}", false);
}
}
}
}
//グレーアウト解除
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
if ($(this).is(":checked")) {
radioOrCheckboxEvent("${answer.answerId}", false);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
radioOrCheckboxEvent("${answer.answerId}", true);
}
}
} else if ("${question.controlId}" == "2"
|| "${question.controlId}" == "3"
|| "${question.controlId}" == "4"
|| "${question.controlId}" == "5"
|| "${question.controlId}" == "6") {
if ("${question.controlId}" == "2") {
$("#${question.questionId}").trigger("change");
}
if ($(this).is(":checked")) {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", false);
} else {
dateEvent("${question.questionId}", false);
}
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
if ("${question.controlId}" != "5") {
etcEvent("${question.questionId}", true);
} else {
dateEvent("${question.questionId}", true);
}
}
}
}
}
}
});
});
// -->
</script>
#end
#end
<body bgcolor="#B3C9E1" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <body bgcolor="#B3C9E1" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center> <center>
......
...@@ -27,65 +27,8 @@ ...@@ -27,65 +27,8 @@
</script> </script>
#end #end
#end #end
#parse( "/WEB-INF/view/common/question_disable.vm" )
</head> </head>
#foreach($question in $!enqueteForm.questionList)
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
$(function() {
//条件付必須チェック
$("input[type=radio], input[type=checkbox], input[type=select]").click(function () {
var thisQuestionId = $(this).attr("class");
var thisAnswerId = $(this).attr("id");
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("checked", false);
$("#${answer.answerId}").attr("disabled", true);
} else if ("${question.controlId}" == "2") {
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").val('');
$("#${question.questionId}").attr("disabled", true);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").val('');
$(".${question.questionId}").attr("disabled", true);
$(".${question.questionId}").next().hide();
}
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("disabled", false);
} else if ("${question.controlId}" == "2") {
if ($(this).is(":checked")) {
$("#${question.questionId}").attr("disabled", false);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
$("#${question.questionId}").val('');
$("#${question.questionId}").attr("disabled", true);
}
}
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").attr("disabled", false);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").attr("disabled", false);
$(".${question.questionId}").next().show();
}
}
}
});
});
// -->
</script>
#end
#end
<body> <body>
<div id="wrapper"> <div id="wrapper">
<div id="logo"><img src="/em/images/ichikawa_logo01.jpg" width="190" height="65" /> <div id="logo"><img src="/em/images/ichikawa_logo01.jpg" width="190" height="65" />
......
...@@ -26,64 +26,7 @@ ...@@ -26,64 +26,7 @@
#end #end
#end #end
</head> </head>
#foreach($question in $!enqueteForm.questionList) #parse( "/WEB-INF/view/common/question_disable.vm" )
#foreach($answer in $question.answerList)
<script language="javascript" type="text/javascript" charset="utf-8">
<!--
$(function() {
//条件付必須チェック
$("input[type=radio], input[type=checkbox], input[type=select]").click(function () {
var thisQuestionId = $(this).attr("class");
var thisAnswerId = $(this).attr("id");
//表示、非表示対象
if (${question.condRequiredQuestionNo} && ${question.condRequiredQuestionNo} == thisQuestionId) {
if ("${question.condRequiredAnswer}".split(",").indexOf(thisAnswerId) < 0) {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("checked", false);
$("#${answer.answerId}").attr("disabled", true);
} else if ("${question.controlId}" == "2") {
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").val('');
$("#${question.questionId}").attr("disabled", true);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").val('');
$(".${question.questionId}").attr("disabled", true);
$(".${question.questionId}").next().hide();
}
} else {
if ("${question.controlId}" == "0" || "${question.controlId}" == "1") {
$("#${answer.answerId}").attr("disabled", false);
} else if ("${question.controlId}" == "2") {
if ($(this).is(":checked")) {
$("#${question.questionId}").attr("disabled", false);
} else {
var array = "${question.condRequiredAnswer}".split(",");
var judgeDisable = true;
for (let i in array) {
if ($("#" + array[i]).is(":checked")) {
judgeDisable = false;
break;
}
}
if (judgeDisable) {
$("#${question.questionId}").val('');
$("#${question.questionId}").attr("disabled", true);
}
}
} else if ("${question.controlId}" == "3" || "${question.controlId}" == "4" || "${question.controlId}" == "6") {
$("#${question.questionId}").attr("disabled", false);
} else if ("${question.controlId}" == "5") {
$(".${question.questionId}").attr("disabled", false);
$(".${question.questionId}").next().show();
}
}
}
});
});
// -->
</script>
#end
#end
<body> <body>
<div id="wrapper"> <div id="wrapper">
......
...@@ -3,6 +3,16 @@ ...@@ -3,6 +3,16 @@
#parse( "/WEB-INF/view/common/preHeader.vm" ) #parse( "/WEB-INF/view/common/preHeader.vm" )
##<!-- JAVASCRIPTはここに記載 --> ##<!-- JAVASCRIPTはここに記載 -->
<script language="JavaScript">
<!--
sent = false;
function send_check(){
document.mainForm.submit();
return false;
}
// -->
</script>
<style type="text/css"> <style type="text/css">
<!-- <!--
.style1 { .style1 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment