<%@ page language="C#" autoeventwireup="true" inherits="ColumnManage_FieldEdit, App_Web_vkwqxb1y" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>编辑字段</title>
    <base target="_self"/>
    <link rel="stylesheet" href="../style/Common.css" />
    <link rel="stylesheet" href="../style/Dialog.css" />
    
    <script type="text/javascript" src="../Script/Common.js"></script>
    <script type="text/javascript">
var btnConfirm, tbTitle, lstSelectType, lstSelectVisible, pnErrorMsg; //tbUploadPath,
function Page_Init()
    {
	btnConfirm = $('btnConfirm');
	tbTitle = $('tbTitle');
//	tbUploadPath = $('tbUploadPath');
	lstSelectType = $('lstSelectType');
	lstSelectVisible = $('lstSelectVisible');
 	pnErrorMsg = $('pnErrorMsg');
 	
	tbTitle.onkeyup  = TitleProcess;
	tbTitle.onblur   = TitleProcess;
	tbTitle.onchange = TitleProcess;
   }

function Page_Load()
    {
	FreshBySelectType();
	if( tbTitle.value ){
	    labName.innerText = '';
	    btnConfirm.disabled = false;
	}
	pnErrorMsg.innerText = Common.ValidateTitleMsg;
    }

function btnConfirm_Click()
    {
	var op = Common.GetQueryString('optype').toLowerCase();
	if( op != 'editfield' ){
	    var name = Common.CreateName(tbTitle.value)
	    $('hfNewName').value = name;
	}
    }

function lstSelectVisible_Change()
    {
    }

function lstSelectType_Change()
    {
	FreshBySelectType();
    }

function FreshBySelectType()
    {
//	if( lstSelectType.value == 'fileUpdate' ){
//	    tbUploadPath.disabled = false;
//	    tbUploadPath.style.backgroundColor = '';
//	    tbUploadPath.style.border = '1px #7f9db9 solid';
//	} else {
//	    tbUploadPath.disabled = true;
//	    tbUploadPath.style.backgroundColor = '#f5f3e5';
//	    tbUploadPath.style.border = '1px #cac8bb solid';
//	}
    }

function TitleProcess()
    {
	var title = tbTitle.value;	
	if( Common.ValidateTitle(title) ){
	    btnConfirm.disabled = false;
	    pnErrorMsg.style.display = 'none';
	} else{
	    btnConfirm.disabled = true;
	    if( title )
	        pnErrorMsg.style.display = 'block';
	    else
	        pnErrorMsg.style.display = 'none';
	}
    }

    </script>
</head>
<body><form id="form1" runat="server">

    <div class="TopArea">
        <h1><asp:Label ID="lbHeading" runat="server" Text="编辑字段" CssClass="Title" /></h1>
        <div class="HeadLogo"></div>
    </div>
    
    <div class="ContentArea" style="margin:12px 40px;">
        <table class="FormTable" style="width:96%">
            <tr>
                <td style="width: 25%">字段名称：</td>
                <td style="width: 75%">
                   <input id="tbTitle" type="text" runat="server" style="width:98%;"/>
                   </td>
            </tr>
            <tr> 
                <td>字段类型：</td>
                <td>
                    <select id="lstSelectType" runat="server" onchange="lstSelectType_Change();" style="width:140px;" ></select>
                </td>
            </tr>
            <tr>
                <td>允许显示在：</td>
                <td>
                    <select id="lstSelectVisible" runat="server" onchange="lstSelectVisible_Change();" style="width:140px;">
                        <option selected="selected" value="always">总是显示</option>
                        <option value="form">内容编辑时显示</option>
                        <option value="list">内容列表中显示</option>
                        <option value="none">总是不显示</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>是否隐藏：</td>
                <td><asp:CheckBox ID="ckIsHide" runat="server" Text="该字段的所有内容不在页面中显示" /></td>
            </tr>
            <tr>
                <td>是否允许为空：</td>
                <td><asp:CheckBox ID="ckAllowBlank" runat="server" Text="允许该字段中的内容为空" /></td>
            </tr>
            <%--<tr>
                <td>上传路径：</td>
                <td><input id="tbUploadPath" type="text" runat="server" style="width:98%;"/></td>
            </tr>--%>
            <tr><td colspan="2" align="center">
                <asp:Label ID="labName" runat="server" ForeColor="Red"></asp:Label>
                <div id="pnErrorMsg" class="ErrorMsg" style="width:356px;"></div>
            </td></tr>
        </table>
     </div>

    <div class="BottomArea">
        <span class="RightBlock">
            <input id="btnConfirm" type="button" value="添加" class="Button" runat="server" disabled="disabled" onclick="btnConfirm_Click();" onserverclick="btnConfirm_ServerClick" />
            <input id="btnCancel" type="button" value="取消" class="Button" onclick="window.close();" />
        </span>
    </div>    

    <asp:HiddenField ID="hfNewName" runat="server" />
    
</form>
<script type="text/javascript">
try{ Page_Init(); }catch(ex){;}
try{ if( Page_Resize ) window.onresize=Page_Resize; }catch(ex){;}
try{ if( Page_Load ) window.onload=Page_Load; }catch(ex){;}
</script>
</body>
</html>

<%--
//	$('selectVisibleValue').value = lstSelectVisible.value;
//	$('selectTypeValue').value = lstSelectType.value;
    <asp:HiddenField ID="selectTypeValue" runat="server" />
    <asp:HiddenField ID="selectVisibleValue" runat="server" />--%>
