<%@ Page Language="C#" MasterPageFile="~/Admin/MainPage.Master" AutoEventWireup="true" CodeBehind="form_item_add.aspx.cs" Inherits="PPFOR.Admin.DesignCenter.Console.form_item_add" Title="添加表单项" %>


<asp:Content ID="Content1" ContentPlaceHolderID="PPFOR_mainContent" runat="server"> 
<script src="../../JS/public.js" type="text/javascript"></script>  
<script language="javascript" type="text/javascript">
    function setControlDisplay(idObj,dValue,idText)
    {
        var obj=document.getElementById(idObj);
        if(obj!=null && obj.style.display!=dValue)
        {
            obj.style.display=dValue;
            if(dValue=="none" && idText!="")
            {
                var objText=document.getElementById(idText);
                if(objText.value!=objText.getAttribute("defaultValue"))
                {
                    objText.setAttribute("defaultValue",objText.value);
                }
                objText.value="";
            }
            else if(dValue=="" && idText!="")
            {
                var objText=document.getElementById(idText);
                if(objText.value=="")
                {
                    objText.value=objText.getAttribute("defaultValue");
                }
            }
        }
    }
    
    function checkItemValidate(obj)
    {
        var vValue=obj.options[obj.selectedIndex].value;
        if(vValue=="0")
        {
            setControlDisplay("displayItemErrMsg","none","");
            setControlDisplay("displayItemValidateText","none","");
        }  
        else
        {
            setControlDisplay("displayItemErrMsg","","");
            setControlDisplay("displayItemValidateText","","");
                    
            var objText=document.getElementById("<%=PPFOR_itemValidateText.ClientID %>");
            if(vValue=="10")
            {
                objText.readOnly=false;
                objText.value="";
            }
            else
            {
                objText.readOnly=true;
                objText.value=obj.options[obj.selectedIndex].getAttribute("validate");
            }
        }
    }
    
    function checkItemType(obj)
    {
        var tValue=obj.options[obj.selectedIndex].value;
        if(tValue=="0" || tValue=="1")
        {
            setControlDisplay("displayItemLength","","<%=PPFOR_itemLength.ClientID %>");
            setControlDisplay("displayItemSize","","<%=PPFOR_itemSize.ClientID %>"); 
            setControlDisplay("displayItemWidth","none","<%=PPFOR_itemWidth.ClientID %>");
            setControlDisplay("displayItemHeight","none","<%=PPFOR_itemHeight.ClientID %>");
            setControlDisplay("displayItemMinValue","none","<%=PPFOR_itemMinValue.ClientID %>");
            setControlDisplay("displayItemMaxValue","none","<%=PPFOR_itemMaxValue.ClientID %>");  
            setControlDisplay("displayItemPoint","none","");     
            setControlDisplay("displayItemValidate","","");
            setControlDisplay("displayItemDefault","","");                
            setControlDisplay("displayItemDefaultSingle","","<%=PPFOR_itemDefaultSingle.ClientID %>");
            setControlDisplay("displayItemDefaultMulti","none","<%=PPFOR_itemDefaultMulti.ClientID %>");         
            setControlDisplay("displayItemSelect","none","<%=PPFOR_itemSelect.ClientID %>");
        }
        else if(tValue=="2" || tValue=="3")
        {
            setControlDisplay("displayItemLength","none","<%=PPFOR_itemLength.ClientID %>");
            setControlDisplay("displayItemSize","none","<%=PPFOR_itemSize.ClientID %>");
            setControlDisplay("displayItemWidth","","<%=PPFOR_itemWidth.ClientID %>");
            setControlDisplay("displayItemHeight","","<%=PPFOR_itemHeight.ClientID %>");
            setControlDisplay("displayItemMinValue","none","<%=PPFOR_itemMinValue.ClientID %>");
            setControlDisplay("displayItemMaxValue","none","<%=PPFOR_itemMaxValue.ClientID %>");   
            setControlDisplay("displayItemPoint","none","");                            
            setControlDisplay("displayItemValidate","none","");
            setControlDisplay("displayItemDefault","","");             
            setControlDisplay("displayItemDefaultSingle","none","<%=PPFOR_itemDefaultSingle.ClientID %>");
            setControlDisplay("displayItemDefaultMulti","","<%=PPFOR_itemDefaultMulti.ClientID %>");           
            setControlDisplay("displayItemSelect","none","<%=PPFOR_itemSelect.ClientID %>");
         }
         else if(tValue=="4")
         {
            setControlDisplay("displayItemLength","none","<%=PPFOR_itemLength.ClientID %>");
            setControlDisplay("displayItemSize","none","<%=PPFOR_itemSize.ClientID %>");
            setControlDisplay("displayItemWidth","none","<%=PPFOR_itemWidth.ClientID %>");
            setControlDisplay("displayItemHeight","none","<%=PPFOR_itemHeight.ClientID %>");
            setControlDisplay("displayItemMinValue","none","<%=PPFOR_itemMinValue.ClientID %>");
            setControlDisplay("displayItemMaxValue","none","<%=PPFOR_itemMaxValue.ClientID %>");   
            setControlDisplay("displayItemPoint","none","");                            
            setControlDisplay("displayItemValidate","none","");
            setControlDisplay("displayItemDefault","","");               
            setControlDisplay("displayItemDefaultSingle","","<%=PPFOR_itemDefaultSingle.ClientID %>");
            setControlDisplay("displayItemDefaultMulti","none","<%=PPFOR_itemDefaultMulti.ClientID %>");
            setControlDisplay("displayItemSelect","none","<%=PPFOR_itemSelect.ClientID %>");
         }
         else if(tValue=="5")
         {
            setControlDisplay("displayItemLength","none","<%=PPFOR_itemLength.ClientID %>");
            setControlDisplay("displayItemSize","none","<%=PPFOR_itemSize.ClientID %>");
            setControlDisplay("displayItemWidth","none","<%=PPFOR_itemWidth.ClientID %>");
            setControlDisplay("displayItemHeight","none","<%=PPFOR_itemHeight.ClientID %>");
            setControlDisplay("displayItemMinValue","","<%=PPFOR_itemMinValue.ClientID %>");
            setControlDisplay("displayItemMaxValue","","<%=PPFOR_itemMaxValue.ClientID %>");
            setControlDisplay("displayItemPoint","","");                               
            setControlDisplay("displayItemValidate","none","");
            setControlDisplay("displayItemDefault","","");              
            setControlDisplay("displayItemDefaultSingle","","<%=PPFOR_itemDefaultSingle.ClientID %>");
            setControlDisplay("displayItemDefaultMulti","none","<%=PPFOR_itemDefaultMulti.ClientID %>");             
            setControlDisplay("displayItemSelect","none","<%=PPFOR_itemSelect.ClientID %>");
         }    
         else if(tValue=="6")
         {
            setControlDisplay("displayItemLength","none","<%=PPFOR_itemLength.ClientID %>");
            setControlDisplay("displayItemSize","none","<%=PPFOR_itemSize.ClientID %>");
            setControlDisplay("displayItemWidth","none","<%=PPFOR_itemWidth.ClientID %>");
            setControlDisplay("displayItemHeight","none","<%=PPFOR_itemHeight.ClientID %>");
            setControlDisplay("displayItemMinValue","none","<%=PPFOR_itemMinValue.ClientID %>");
            setControlDisplay("displayItemMaxValue","none","<%=PPFOR_itemMaxValue.ClientID %>");   
            setControlDisplay("displayItemPoint","none","");                            
            setControlDisplay("displayItemValidate","none","");
            setControlDisplay("displayItemDefault","none","<%=PPFOR_itemDefaultSingle.ClientID %>");
            setControlDisplay("displayItemDefault","none","<%=PPFOR_itemDefaultMulti.ClientID %>");
            setControlDisplay("displayItemDefault","none","");
            setControlDisplay("displayItemSelect","none","<%=PPFOR_itemSelect.ClientID %>");
         }       
         else if(tValue=="7" || tValue=="8" || tValue=="9" || tValue=="10")
         {
            setControlDisplay("displayItemLength","none","<%=PPFOR_itemLength.ClientID %>");
            setControlDisplay("displayItemSize","none","<%=PPFOR_itemSize.ClientID %>");
            setControlDisplay("displayItemWidth","none","<%=PPFOR_itemWidth.ClientID %>");
            setControlDisplay("displayItemHeight","none","<%=PPFOR_itemHeight.ClientID %>");
            setControlDisplay("displayItemMinValue","none","<%=PPFOR_itemMinValue.ClientID %>");
            setControlDisplay("displayItemMaxValue","none","<%=PPFOR_itemMaxValue.ClientID %>");   
            setControlDisplay("displayItemPoint","none","");                            
            setControlDisplay("displayItemValidate","none","");
            setControlDisplay("displayItemDefault","","");    
            setControlDisplay("displayItemDefaultSingle","","<%=PPFOR_itemDefaultSingle.ClientID %>");
            setControlDisplay("displayItemDefaultMulti","none","<%=PPFOR_itemDefaultMulti.ClientID %>");           
            setControlDisplay("displayItemSelect","","<%=PPFOR_itemSelect.ClientID %>");
         }
    }
    function validateItemPrompt(source,args)
    {
        var obj=document.getElementById('<%= PPFOR_itemPrompt.ClientID %>');
        if(obj.value.length>255)
        {
            args.IsValid=false;
        }
        else
        {
            args.IsValid=true;
        }
    }
    function validateDefaultSingle(source,args)
    {
        args.IsValid=checkDefaultSingle();
    }
    function checkDefaultSingle()
    {
        var objDefault=document.getElementById("<%=PPFOR_itemDefaultSingle.ClientID %>");
        if(objDefault.value=="")
        {
            return true;
        }
        var obj=document.getElementById("<%=PPFOR_itemTypeList.ClientID %>");
        var tValue=obj.options[obj.selectedIndex].value;     
        if(tValue=="0" || tValue=="1")
        {
            var objValidate=document.getElementById("<%=PPFOR_itemValidateType.ClientID %>");
            var vTyleValue=objValidate.options[objValidate.selectedIndex].value;   
            var objValidateText=document.getElementById("<%=PPFOR_itemValidateText.ClientID %>");
            var vValue=objValidateText.value;   
            var objLength=document.getElementById("<%=PPFOR_itemLength.ClientID %>");
             
            if(objLength.value!="")
            {
                var lValue=parseInt(objLength.value);
                if(objDefault.value.length>lValue)
                {
                    return false;
                }
            }
            if(vTyleValue=="0" || vValue=="")
            {
                return true;
            }
            else
            {
                var reg=new RegExp(vValue);
                return  reg.test(objDefault.value);
            }
        }
        else if(tValue=="4")
        {
            var regStr=/^((\d{2}(([02468][048])|([13579][26]))[\-\/\s]((((0?[13578])|(1[02]))[\-\/\s]((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]((0?[1-9])|([1-2][0-9])))))|(\d{2}(([02468][1235679])|([13579][01345789]))[\-\/\s]((((0?[13578])|(1[02]))[\-\/\s]((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]((0?[1-9])|(1[0-9])|(2[0-8]))))))(\s(((0?[0-9])|(2[0-3])|(1[0-9]))\:([0-5]?[0-9])((\s)|(\:([0-5]?[0-9])))?))?$/;
            return regStr.test(objDefault.value);
        }
        else if(tValue=="5")
        {
            var objMin=document.getElementById("<%=PPFOR_itemMinValue.ClientID %>");
            var objMax=document.getElementById("<%=PPFOR_itemMaxValue.ClientID %>");
            var objPoint=document.getElementById("<%=PPFOR_itemPoint.ClientID %>");
            var dValue=parseFloat(objDefault.value.trim());
            var minValue=0;
            var maxValue=2147483647;
            if(objMin.value!="")
            {
                minValue=parseInt(objMin.value);
            }
            if(objMax.value!="")
            {
                maxValue=parseInt(objMax.value);
            }
            if(dValue>=minValue && dValue<=maxValue)
            {
                var pValueTmp=objPoint.options[objPoint.selectedIndex].value;
                var pValue=0;
                if(pValueTmp!="")
                {
                    pValue=parseInt(pValueTmp);
                }
                var regStr="^(0|([1-9][0-9]*))";
                if(pValue>0)
                {
                    regStr=regStr + "(.[0-9]{" + pValue + "})?$";
                }
                else if(pValue==-1)
                {
                    regStr=regStr + "(.[0-9]{0,4})?$";
                }
                else
                {
                    regStr=regStr + "$";
                }
                var reg=new RegExp(regStr);
                return reg.test(objDefault.value.trim());
            }
            else
            {
                return false;
            }
        }
        else if(tValue=="7" || tValue=="8" || tValue=="9" || tValue=="10")
        {
            var obj=document.getElementById('<%= PPFOR_itemSelect.ClientID %>');
            var vValues="|";
            if(obj.value.trim().length>0)
            {//获取所有选项值
                var lines=obj.value.replace('\r','').split('\n');
                if(lines.length>0)
                {
                    var index=0;
                    for(;index<lines.length;index++)
                    {
                        var item=lines[index].trim();
                        if(item!="")
                        {
                            items=item.split('|');
                            if(items.length==2)
                            {
                                if(items[0]!="" && items[1]!="" &&　items[1].indexOf(',')==-1)
                                {
                                    if(vValues.indexOf("|" + items[1] + "|")<0)
                                    {
                                        vValues=vValues + items[1] + "|";
                                    }
                                }   
                            }
                        }
                    }
                }
            }
            if(vValues!="|")
            {
                if(objDefault.value.indexOf('|')<0 && vValues.indexOf("|" + objDefault.value + "|")>=0)
                {
                    return true;
                }
                else if((tValue=="8" || tValue=="10") && objDefault.value.indexOf('|')>0)
                {
                    var dValues=objDefault.value.split('|');
                    var index=0;
                    for(;index<dValues.length;index++)
                    {
                        if(dValues[index]=="" || vValues.indexOf("|" + dValues[index] + "|")<0)
                        {
                            return false;
                        }
                        else
                        {
                            vValues=vValues.replace("|" + dValues[index] + "|","|");
                        }
                    } 
                    return true;
                }
            }    
            return false;  
        }
    }
    
    function validateItemSelect(source,args)
    {
        var obj=document.getElementById('<%= PPFOR_itemSelect.ClientID %>');
        if(obj.value.length>0)
        {
            var lines=obj.value.replace('\r','').split('\n');
            if(lines.length>0)
            {
                var index=0;
                var vValues="|";
                for(;index<lines.length;index++)
                {
                    var item=lines[index].trim();
                    if(item=="" && index!=lines.length-1)
                    {
                        break;
                    }
                    else
                    {
                        items=item.split('|');
                        if(items.length==2)
                        {
                            if(items[0]=="" || items[1]=="")
                            {
                                break;
                            }
                            else
                            {
                                if(vValues.indexOf("|" + items[1] + "|")!=-1 || items[1].indexOf(',')!=-1)
                                {//存在相同的值或有英文逗号
                                    break;
                                }
                                else
                                {
                                    vValues=vValues + items[1] + "|";
                                }
                            }   
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                if(index==lines.length)
                {
                    args.IsValid=true;
                    return;
                }
            }
        }
        args.IsValid=false;
    }
</script>
<div>
<form action="form_item_add.aspx" method="post" id="form1" runat="server">
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="fortable">
        <thead>
            <tr>
              <td colspan="2" align="center">添加表单项</td>
            </tr>
        </thead>
        <tr>
            <td style="width:15%" align="right">当前表单：</td>
            <td><asp:Label ID="PPFOR_formName" runat="server"></asp:Label><asp:Label ID="PPFOR_formId" runat="server" Visible="false" Enabled="false"></asp:Label><asp:Label ID="PPFOR_formTableName" runat="server" Visible="false" Enabled="false"></asp:Label></td>
        </tr>
        <tr>
            <td align="right">表单项名称：</td>
            <td><asp:TextBox ID="PPFOR_itemName" runat="server" TextMode="SingleLine" Maxlength="20" Width="150px" Text=""></asp:TextBox>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" SetFocusOnError="true" Display="Dynamic" ControlToValidate="PPFOR_itemName">表单项名称不能为空</asp:RequiredFieldValidator>
          </td>
        </tr>
        <tr>
          <td align="right">字段名：</td>
          <td><asp:TextBox ID="PPFOR_itemFieldName" runat="server" TextMode="SingleLine" Maxlength="32" Width="150px"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" SetFocusOnError="true" Display="Dynamic" ControlToValidate="PPFOR_itemFieldName">字段名不能为空</asp:RequiredFieldValidator>
          <br /><asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" SetFocusOnError="true" ValidationExpression="^[A-Za-z0-9][A-Za-z0-9_]{1,31}$" Display="Dynamic" ControlToValidate="PPFOR_itemFieldName">&nbsp;字段名只能包含英文字母、数字或者下划线，不能以下划线开头，且长度在2到32个字符在之间</asp:RegularExpressionValidator>
          </td>
        </tr>
         <tr>
          <td align="right">是否启用：</td>
          <td><asp:RadioButtonList CssClass="innertable" ID="PPFOR_itemState" runat="server" RepeatDirection="Horizontal">
            <asp:ListItem Text="是" Value="1" Selected="True"></asp:ListItem>
            <asp:ListItem Text="否" Value="0" Selected="False"></asp:ListItem>
          </asp:RadioButtonList>
          </td>
        </tr>
         <tr>
          <td align="right">是否必填：</td>
          <td><asp:RadioButtonList CssClass="innertable" ID="PPFOR_itemNotNull" runat="server" RepeatDirection="Horizontal">
            <asp:ListItem Text="是" Value="1" Selected="True"></asp:ListItem>
            <asp:ListItem Text="否" Value="0" Selected="False"></asp:ListItem>
          </asp:RadioButtonList>
          </td>
        </tr>        
        <tr>
          <td align="right">表单项类型：</td>
          <td><asp:DropDownList ID="PPFOR_itemTypeList" runat="server">
            
          </asp:DropDownList>
          </td>
        </tr>
        <tr id="displayItemLength">
            <td align="right">最大字符数：</td>
            <td><asp:TextBox ID="PPFOR_itemLength" runat="server" Text="20" MaxLength="3"></asp:TextBox>
             <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="PPFOR_itemLength" Display="Dynamic" ErrorMessage="最大字符数必须是1至255之间的整数" MaximumValue="255" MinimumValue="1" SetFocusOnError="True" Type="Integer"></asp:RangeValidator>
            </td>
        </tr>
        <tr id="displayItemSize">
            <td align="right">文本框长度：</td>
            <td><asp:TextBox ID="PPFOR_itemSize" runat="server" Text="20" MaxLength="3"></asp:TextBox>
             <asp:RangeValidator ID="RangeValidator3" runat="server" ControlToValidate="PPFOR_itemSize" Display="Dynamic" ErrorMessage="文本框长度必须是1至255之间的整数" MaximumValue="255" MinimumValue="1" SetFocusOnError="True" Type="Integer"></asp:RangeValidator>
            </td>
        </tr>
        <tr id="displayItemWidth" style="display:none;">
            <td align="right">宽度：</td>
            <td><asp:TextBox ID="PPFOR_itemWidth" runat="server" Text="400" MaxLength="4"></asp:TextBox>&nbsp;px
            <asp:RangeValidator ID="RangeValidator6" runat="server" ControlToValidate="PPFOR_itemWidth" Display="Dynamic" ErrorMessage="宽度必须是1至9999之间的整数" MaximumValue="9999" MinimumValue="1" SetFocusOnError="True" Type="Integer"></asp:RangeValidator>
            </td>
        </tr>
        <tr id="displayItemHeight" style="display:none;">
            <td align="right">高度：</td>
            <td><asp:TextBox ID="PPFOR_itemHeight" runat="server" Text="200" MaxLength="4"></asp:TextBox>&nbsp;px
            <asp:RangeValidator ID="RangeValidator7" runat="server" ControlToValidate="PPFOR_itemHeight" Display="Dynamic" ErrorMessage="高度必须是1至9999之间的整数" MaximumValue="9999" MinimumValue="1" SetFocusOnError="True" Type="Integer"></asp:RangeValidator>
            </td>
        </tr> 
        <tr id="displayItemMinValue" style="display:none;">
            <td align="right">最小值：</td>
            <td><asp:TextBox ID="PPFOR_itemMinValue" runat="server" Text="" MaxLength="10"></asp:TextBox>
            <asp:RangeValidator ID="RangeValidator4" runat="server" ControlToValidate="PPFOR_itemMinValue" Display="Dynamic" ErrorMessage="最小值必须是非负整数，为空默认为0" MaximumValue="2147483647" MinimumValue="0" SetFocusOnError="True" Type="Integer"></asp:RangeValidator>
            </td>
        </tr>
        <tr id="displayItemMaxValue" style="display:none;">
            <td align="right">最大值：</td>
            <td><asp:TextBox ID="PPFOR_itemMaxValue" runat="server" Text="" MaxLength="10"></asp:TextBox>
            <asp:RangeValidator ID="RangeValidator5" runat="server" ControlToValidate="PPFOR_itemMaxValue" Display="Dynamic" ErrorMessage="最大值必须是非负整数，为空默认为2147483647" MaximumValue="2147483647" MinimumValue="0" SetFocusOnError="True" Type="Integer"></asp:RangeValidator>
            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="PPFOR_itemMaxValue" ControlToCompare="PPFOR_itemMinValue" ErrorMessage="最大值必须不小于最小值" Display="Dynamic" Type="Integer" SetFocusOnError="true" Operator="GreaterThanEqual"></asp:CompareValidator>
            </td>
        </tr>
        <tr id="displayItemPoint" style="display:none;">
            <td align="right">小数位数：</td>
            <td><asp:DropDownList ID="PPFOR_itemPoint" runat="server">
                    <asp:ListItem Text="自动" Value="-1" Selected="True"></asp:ListItem>
                    <asp:ListItem Text="0" Value="0"></asp:ListItem>
                    <asp:ListItem Text="1" Value="1"></asp:ListItem>
                    <asp:ListItem Text="2" Value="2"></asp:ListItem>
                    <asp:ListItem Text="3" Value="3"></asp:ListItem>
                    <asp:ListItem Text="4" Value="4"></asp:ListItem>
                    </asp:DropDownList></td>
        </tr>
        <tr id="displayItemValidate">
            <td align="right">验证规则：</td>
            <td>
            <table class="innertable">
                <tr>
                    <td><asp:DropDownList ID="PPFOR_itemValidateType" runat="server">
                    </asp:DropDownList></td>
                    <td id="displayItemValidateText" style="display:none;"><asp:TextBox ID="PPFOR_itemValidateText" runat="server" Width="400px"></asp:TextBox></td>
                </tr>
                <tr id="displayItemErrMsg" style="display:none;">
                    <td align="right">&nbsp;验证错误提示：</td>
                    <td><asp:TextBox ID="PPFOR_itemErrMsg" runat="server" MaxLength="255" Width="400px"></asp:TextBox></td>
                </tr>                
            </table>
            </td>
        </tr>
        <tr id="displayItemSelect" style="display:none;">
            <td align="right">选项：</td>
            <td>
                <table class="innertable">
                <tr>
                    <td><asp:TextBox ID="PPFOR_itemSelect" runat="server" MaxLength="255" TextMode="MultiLine" Rows="5" Width="300px" Height="98%"></asp:TextBox></td>
                    <td>
                        <ul>
                            <li>每一行为一个选项</li>
                            <li>选项显示的文本跟选项值之间必须用“|”字符分隔开</li>
                            <li>选项值中不允许出现英文逗号“,”和分隔符“|”</li>
                            <li>选项格式：选项文本|选项值，如“长登科技|ppfor”</li>
                            <li>默认选项值有多个的，用分隔符“|”连接多个选项值</li>
                        </ul> 
                    </td>
                </tr>
                <tr>
                <td colspan="2">
                <asp:CustomValidator ID="CustomValidator2" runat="server" Display="Dynamic" SetFocusOnError="true" ControlToValidate="PPFOR_itemSelect" ClientValidationFunction="validateItemSelect">&nbsp;选项文本跟选项值之间必须用“|”字符分隔开，选项值不能重复，<br />选项值不能包含英文逗号“,”和分隔符“|”，且不允许出现空选项</asp:CustomValidator>
                </td>
                </tr>
                </table>
            </td>
        </tr>         
        <tr id="displayItemDefault">
            <td align="right">默认值：</td>
            <td><span id="displayItemDefaultSingle"><asp:TextBox ID="PPFOR_itemDefaultSingle" runat="server" MaxLength="255" Width="300px"></asp:TextBox><br />
            <asp:CustomValidator ID="CustomValidator3" runat="server" ControlToValidate="PPFOR_itemDefaultSingle" ClientValidationFunction="validateDefaultSingle" Display="Dynamic" SetFocusOnError="true">&nbsp;默认值不符合验证规则，或默认值不在选项值中，或默认值有重复项值</asp:CustomValidator>
            </span>
            <span id="displayItemDefaultMulti" style="display:none;"><asp:TextBox ID="PPFOR_itemDefaultMulti" runat="server" Width="300px" Rows="5" TextMode="MultiLine"></asp:TextBox><br />
            </span>
            </td>
        </tr>          
        <tr>
          <td align="right">附加提示：</td>
          <td><asp:TextBox TextMode="MultiLine" MaxLength="255" ID="PPFOR_itemPrompt" runat="server" Height="80px" Width="300px"></asp:TextBox><span>在名称旁的提示信息</span><br />
          <asp:CustomValidator ID="CustomValidator1" runat="server" Display="Dynamic" SetFocusOnError="true" ControlToValidate="PPFOR_itemPrompt" ClientValidationFunction="validateItemPrompt">&nbsp;附加提示长度必须在255个字符以内</asp:CustomValidator>
          </td>
        </tr>                  
        <tr>
            <td colspan="2" align="center" valign="middle" style="height:50px; display:none">
                <asp:Button ID="PPFOR_addCustomItemInfo" CssClass="inputbutton" runat="server" Text="添加" OnClick="PPFOR_createCustomItemInfo"/>
                <input name="reset" type="reset" id="reset1" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" value="重置" />
                <asp:Label ID="PPFOR_goToItemList" runat="server"></asp:Label>
                <script type="text/javascript">                    
                    addButtonArray("<%= PPFOR_addCustomItemInfo.ClientID %>","reset1","goBack");                    
                </script>  
            </td>
        </tr>
      </table>
      <br />
</form>
</div>
</asp:Content>

