Index: lams_tool_survey/web/includes/javascript/surveyitem.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/javascript/surveyitem.js,v diff -u -r1.1 -r1.2 --- lams_tool_survey/web/includes/javascript/surveyitem.js 14 Sep 2006 06:44:13 -0000 1.1 +++ lams_tool_survey/web/includes/javascript/surveyitem.js 18 Sep 2006 02:14:05 -0000 1.2 @@ -25,49 +25,6 @@ ); } - function changeMaxAnswerOptions(initVal){ - var tb = document.getElementById("questionTable"); - var num = tb.getElementsByTagName("tr"); - var numLen = num.length; - //remove button row - if(numLen > 0) - --numLen; - - var sel = document.getElementById("maxAnswerSelect"); - var newField = sel.options; - var len = sel.length; - - if(numLen == 0){ - sel.disabled = true; - return; - }else - sel.disabled = false; - - //when first enter, it should get value from Resource - var selIdx=initVal < 0?-1:initVal; - //there is bug in Opera8.5: if add alert before this loop, it will work,weird. - for (var idx=0;idx 0 && selIdx==i){ - opt.selected = true; - }else{ - opt.selected = false; - } - opt.appendChild(optT); - sel.appendChild(opt); - } - } function addInstruction(){ var url= addInstructionUrl; var reqIDVar = new Date(); @@ -109,7 +66,6 @@ function removeInstructionComplete(){ hideBusy(instructionTargetDiv); - changeMaxAnswerOptions(-1); } function addInstructionLoading(){ @@ -118,7 +74,6 @@ function addInstructionComplete(){ hideBusy(instructionTargetDiv); - changeMaxAnswerOptions(-1); } function showBusy(targetDiv){ if($(targetDiv+"_Busy") != null){ @@ -132,10 +87,9 @@ } function submitSurveyItem(){ - $("instructionList").value = Form.serialize("instructionForm"); + if($("instructionList") != null) + $("instructionList").value = Form.serialize("instructionForm"); $("surveyItemForm").submit(); - //after submit, it direct to itemlist.jsp, - // then refresh "basic tab" surveylist and close this window. } function cancelSurveyItem(){ window.top.hideMessage();