<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>">
<link href=images/style.css rel=stylesheet type=text/css>
<script language=javascript>
function chkform()
{
	if(document.form.cusname.value==""){
		alert('请输入名称！');
		document.form.cusname.focus();
		return false;
	}
	if(document.form.catid.value=="0"){
		alert('请选择！');
		document.form.catid.focus();
		return false;
	}
}
function showtype(val)
{
	if(val=='0'){
		text1.style.display='none';
	}else {
		text1.style.display='';
	}
}
</script>
</head>
<body>
<table width=96% border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>
<tr>
  <td height=25  class=header> 添加自定义属性</td>
</tr>
<tr><td  align=center bgcolor=#FFFFFF>
<table width=96% align=center border=0 cellspacing=1 cellpadding=4 style="height:auto">
<form method=post onsubmit="return chkform();" name="form" action="custom.php?act=insert">
<tr>
  <td width="39%" align="right">属性名称： </td>
  <td width="61%"> <input name="cusname" type="text" id="cusname" value="" size="30"  class="dfinput">  
  *</td>
</tr>
<tr>
  <td align="right">所属分类： </td>
  <td>
    <select name="catid" id="catid" >
      <option value="0">请选择分类</option>
		<?php
		echo $cat_list;
		?>
    </select>
    * </td>
</tr>
<tr>
  <td align="right">能否进行搜索： </td>
  <td>
    <select name="search" id="search" >
    <option value="0" selected>不用搜索</option>
    <option value="1">关键字搜索</option>
    <option value="2">范围搜索</option>
	<option value="3">列表搜索</option>
	<option value="4">多选搜索</option>
    </select>属性值为单行文本时，才能使用范围搜索。</td>
</tr>
<tr>
  <td align="right">属性类型：</td>
  <td><select name="custype" id="custype" onChange="showtype(this.value)" >
    <option value="0">单行文本</option>
    <option value="1">列表框</option>
    <option value="2">复选框</option>
  </select></td>
</tr>
<tr id=text1 name=text1 style='display:none'>
  <td align="right">属性值：</td>
  <td><textarea name="value" cols="50" rows="9" id="value"></textarea>每行一个值</td>
</tr>
<tr>
  <td align="right">单位：</td>
  <td><input name="unit" type="text" id="unit" value="" size="30"  class="dfinput"> </td>
</tr>

<tr><td colspan="2" align="center">
<input type="submit" name="submit" value=" 提 交 " class="newFormBtn_red2"  />&nbsp;&nbsp; 
<input type="reset" value=" 重 置 " > 
</td></tr>
</form>
</table>
</td>
</tr>
</table>
</body>
</html>