<html>
<head>
<meta http-equiv=content-language content=zh-cn>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<style>
 td { padding:2px 5px 2px 5px;}
</style>
<link href="../CSS/Base.css" rel=stylesheet>
<LINK href="../CSS/Window.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="../JS/Common.js.php"></script>
<script type="text/javascript" src="../JS/Window.js.php"></script>
<script language=javascript src="../JS/Textarea.js.php"></script>
<script language=javascript src="../JS/HighLight.js.php"></script>
<script language=javascript src="../JS/CheckQuestion.js.php"></script>
<script language=javascript>
var editTextRange;
function Check_Form_Validator()
{
	if (!CheckNotNull(Check_Form.questionName, "题目文字")) {return false;}
	if (!CheckNotNull(Check_Form.maxLength, "文本输入框长度")) {return false;}
	if (!CheckNumber(Check_Form.maxLength, "文本输入框长度",2,80)) {return false;}
	//if ( document.Check_Form.isRequired.checked)
	//{
	    switch( Check_Form.isCheckType.value )
		{
		   case '0':
		   case '1':
		   case '3':
		   case '5':
		   case '6':
		   case '7':
		   case '8':
		   case '9':
		   break;
		   case '2':
		   case '4':
			    if (!CheckNotNull(Check_Form.minOption, "要求的输入最少值")) {return false;}
			    if (!CheckNotNull(Check_Form.maxOption, "要求的输入最多值")) {return false;}
				if (!CheckMinMaxNum(Check_Form.minOption, "要求的输入最少值")) {return false;}
			    if (!CheckMinMaxNum(Check_Form.maxOption, "要求的输入最多值")) {return false;}
				if (Number( Check_Form.maxOption.value ) < Number(Check_Form.minOption.value) )
				{
					alert('区间值的最多值必须大于最少值');
					Check_Form.maxOption.focus();
					return false;
				}
		   break;
		}
	//}
}
//检查输入内容是否为数字
function CheckMinMaxNum(objField, strText) {
  if (objField.value == "") return true;
  var RE = new RegExp("[^0-9]");
  if (objField.value.search(RE) != -1) {
    alert("“" + strText + "”中只能填写整数！");
    objField.focus();
    return false;
  }
  return true;
}

function checkIsRequired()
{
   if (document.Check_Form.isRequired.checked)
   {
		//document.Check_Form.isCheckType.disabled  = false		
		//document.Check_Form.minOption.disabled  = false
		//document.Check_Form.maxOption.disabled  = false
   } 
   else
   {
		//document.Check_Form.isCheckType.disabled  = true		
		//document.Check_Form.minOption.disabled  = true
		//document.Check_Form.maxOption.disabled  = true
   }	
}
function checkIsCheckType(value)
{
   switch( value )
   {
		case '0':
		case '1':
		case '3':
		case '5':
		case '6':
		case '7':
		case '8':
		case '9':
		   document.Check_Form.minOption.disabled  = true
		   document.Check_Form.maxOption.disabled  = true
		   document.getElementById("checkInfo").innerHTML= '';
		break;
		case '2':
		   document.Check_Form.minOption.disabled  = false
		   document.Check_Form.maxOption.disabled  = false
		   document.getElementById("checkInfo").innerHTML= '字符串长度：';
		break;
		case '4':
		   document.Check_Form.minOption.disabled  = false
		   document.Check_Form.maxOption.disabled  = false
		   document.getElementById("checkInfo").innerHTML= '数值区间：';
		break;
   }
}
function Init()
{
	//checkIsRequired();
	checkIsCheckType('{isCheckType}');
}
</script>

<meta content="mshtml 6.00.3790.0" name=generator></head>
<body oncontextmenu="return false" onload="javascript:Init();" style="margin-top:0px">
  <table class=datatable style="line-height: 150%;border-collapse:collapse;" cellspacing=0 cellpadding=0 bordercolor=#b5cfd9 border=1 width=100%>
   <div class=position>位置：&nbsp; 我的问卷 &raquo; 编辑问卷问题 &raquo; 填空题</div>
   <tr><td colspan="2" bgcolor="#e9e9e9"><b>编辑问卷问题</b></td></tr>
   <form method="post" action="" name="Check_Form" onsubmit="return Check_Form_Validator()">
   <tr><td>&nbsp;<span style="font-size:14px;font-weight:bold;">填空题</span>&nbsp;
     <a onmouseover="this.T_WIDTH=446;this.T_PADDING=0;this.T_BGCOLOR='#ffffff'; return escape('<img src=../Images/Example/example_text.jpg width=446 align=center>')" href="javascript:void(0);"><font color=red>图例</font></a></td></tr>
   <tr bgcolor="#f5f5f5" height=25><td><b>&nbsp;题目文字</b>&nbsp;<img src="../Images/info.gif" border=0>
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="javascript:{var textEditor = document.getElementById('questionName');textEditor.focus();editTextRange = textEditor.document.selection.createRange();showPopWin('ShowInsertImage.php', 590, 260, null, null,'插入图片或视频');}"><font color=red><b>插入图片或视频</font></b></a><img src="../Images/list_menu_arrow.gif" border=0>
   </td></tr>
   <tr><td><textarea rows=5 cols=128 name="questionName" id="questionName" tabIndex=1>{questionName}</textarea>  <a href="javascript:resizeTextHeight('questionName',1);"><img src="../Images/jia.gif"></a><a href="javascript:resizeTextHeight('questionName',-1);"><img src="../Images/jian.gif"></a></td></tr>
   <tr bgcolor="#f5f5f5" height=25><td>&nbsp;有关问题的说明或问题回复提示&nbsp;<img src="../Images/info.gif" border=0></td></tr>
   <tr><td><textarea rows=3 cols=128 name="questionNotes" id="questionNotes" tabIndex=1>{questionNotes}</textarea>  <a href="javascript:resizeTextHeight('questionNotes',1);"><img src="../Images/jia.gif"></a><a href="javascript:resizeTextHeight('questionNotes',-1);"><img src="../Images/jian.gif"></a></td></tr>
   <tr bgcolor="#f5f5f5" height=25><td><b>&nbsp;显示设置</b>&nbsp;<img src="../Images/info.gif" border=0></td></tr>
   <tr><td>
	    &nbsp;&nbsp;&nbsp;文本输入框长度 <input type="text" value="{maxLength}" name="maxLength" size=6> <br/>
   </td></tr>
   <tr bgcolor="#f5f5f5" height=25><td><b>&nbsp;控制设置</b>&nbsp;<img src="../Images/info.gif" border=0></td></tr>
   <tr><td>
	    &nbsp;&nbsp;<input type="checkbox" value="1" name="isRequired" {isRequired} onclick="checkIsRequired();"> 此题为必答题 <br/>
        &nbsp;&nbsp;&nbsp;输入检查规则&nbsp;
            <Select name="isCheckType" onchange="checkIsCheckType(document.Check_Form.isCheckType.options[document.Check_Form.isCheckType.selectedIndex].value);">
		     <option value="0" {isCheckType0}>请选择输入检查规则</option>
		     <option value="1" {isCheckType1}>检查输入为Email</option>
		     <option value="2" {isCheckType2}>检查字符串长度</option>
		     <option value="3" {isCheckType3}>禁止字符串出现中文</option>
		     <option value="4" {isCheckType4}>检查输入为数值</option>
		     <option value="5" {isCheckType5}>检查输入为电话号码</option>
		     <option value="6" {isCheckType6}>检查输入为日期</option>
		     <option value="7" {isCheckType7}>检查输入为身份证号</option>
		     <option value="8" {isCheckType8}>检查输入为企业法人代码</option>
		     <option value="9" {isCheckType9}>检查输入为邮政编码</option>
		    </select>&nbsp;&nbsp;<span id=checkInfo>区间值：</span>最少：<input name="minOption" type="text" size=4 value="{minOption}">&nbsp;最多：<input name="maxOption" type="text" size=4  value="{maxOption}"><br/>
	  </td>
   </tr></table><table width=100%>
   <tr> 
  	 <td height="15">
         <input name="surveyID" type="hidden" id="surveyID" value="{surveyID}"> 
         <input name="questionID" type="hidden" id="questionID" value="{questionID}"> 
         <input name="orderByID" type="hidden" id="orderByID" value="{orderByID}">
         <input class=inputsubmit name="AddTextSubmit" type=submit id="AddTextSubmit" value="保存，下一个" > 
         <input class=inputsubmit name="AddTextOver" type=submit id="AddTextOver" value="保存，结束" > 
         <input class=inputsubmit type="button" name="close" value="  关闭  " onClick="javascript:parent.hidePopWin();">
      </td>
    </tr>
  </form>
 </table>
<script type="text/javascript">initInputHighlightScript();</script> 
<script language=javascript src="../JS/Example.js.php"></script>
</body></html>
