<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="commentform_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.label.commentform_parameter" %>

<!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>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function ReturnValue()
{      
   //自定义内容
    var mystyle = document.getElementById("txtLabelContent").value;
    if(mystyle.indexOf("[#form_Score]")<0)
    {
        alert("请选择固定样式中评分!");
        return false;
    }
    if(mystyle.indexOf("[#form_title]")<0)
    {
        alert("请选择固定样式中标题!");
        return false;
    }
    if(mystyle.indexOf("[#form_lable]")<0)
    {
        alert("请选择固定样式中标签!");
        return false;
    }
	var cnm ="[YX:unLoop,YX:LableType=Comment,YX:Option=CommentForm]"+mystyle+"[/YX:unLoop]";	 
    parent.getValue(cnm);
	 CloseDiv();

}

function getValue(value)
    {
        var textObj=document.getElementById("txtLabelContent");
        var textFeildValue=value;
        if(value!="") 
        {
            if(document.all)
            {     
                if(textObj.createTextRange && textObj.caretPos)
                {   
                    var caretPos=textObj.caretPos;   
                    caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
                }
                else
                {   
                    textObj.value=textFeildValue;   
                }   
            }
            else
            {   
                if(textObj.setSelectionRange)
                {   
                    var rangeStart =textObj.selectionStart;   
                    var rangeEnd=textObj.selectionEnd;   
                    var tempStr1=textObj.value.substring(0,rangeStart);   
                    var tempStr2 =textObj.value.substring(rangeEnd);   
                    textObj.value=tempStr1+textFeildValue+tempStr2;   
                }
                else
                {   
                    alert("This version of Mozilla based browser does not support setSelectionRange");   
                }   
            }
        }
    }
    function setCaret(textObj)
    {   
        if(textObj.createTextRange)
        {   
            textObj.caretPos=document.selection.createRange().duplicate();   
        }   
    } 
function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <table style="width: 100%;" class="form_table_input" >
          <tr>
            <td>自定义样式</td>
            <td>
             <asp:DropDownList ID="ddlComment" runat="server" onchange="javascript:getValue(this.value);">
             
            </asp:DropDownList>
            </td>
            <td>固定样式</td>
            <td>
                <asp:DropDownList ID="ddl" runat="server" onchange="javascript:getValue(this.value);"> 
                    <asp:ListItem Value="" Text="-请选择样式-" />
                    <asp:ListItem Value="[#form_Score]" Text="评分" />
                    <asp:ListItem Value="[#form_title]" Text="标题" />
                    <asp:ListItem Value="[#form_lable]" Text="标签" />
                    <asp:ListItem Value="[#form_button]" Text="提交铵钮" />
                </asp:DropDownList><span style="color:Red">注：该样式是前台评论信息显示的主要样式，<br />在定制表单时一定要添加该样式。</span>
            </td>
          </tr>
           <tr>
                <td colspan="4">
                    <asp:TextBox runat="server" ID="txtLabelContent" height="200" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="600" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
             <tr>
                <td colspan="4" align="center" style="text-align:center">
                   <input id="bt_Exc" type="button" value="提交" onclick="ReturnValue()" />
                    &nbsp;<input class="form" type="button" value=" 关 闭 "  onclick="javascript:CloseDiv();" /></td>
            </tr>
       </table>
    </div>
    </form>
</body>
</html>