@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section header{
    <script type="text/javascript" src="@Url.Content("~/Scripts/ckeditor/ckeditor.js")"></script>
    <script type="text/javascript">
        $(function () {
            var form = document.forms['helpaddform'];
            $(form).submit(function () {
                var Title = $.trim(this.Title.value);
                var Content = CKEDITOR.instances.CKEditorID.getData();
                var SortNumber = $.trim(this.SortNumber.value);
                if (Title == '') {
                    alert("标题不能为空");
                    return false;
                }
                if (SortNumber == '') {
                    alert("排序码不能为空");
                    return false;
                }
                if (Content == '') {
                    alert("内容不能为空");
                    return false;
                }
                return true;
            });
        });
    </script>
}
@section menu_left{
    @Html.Partial("~/Views/Shared/_Partial_Menu_Left.cshtml", 1)
}
@section menu_top{
    @Html.Partial("~/Views/Shared/_Partial_Menu_Top.cshtml", 1)
}
<div class="nv">
    <div class="nv-left">
        当前位置：帮助管理 > 帮助列表 > 添加帮助信息
    </div>
</div>
<div class="content">
    @using (Html.BeginForm("add", "help", FormMethod.Post, new { name = "helpaddform", @class = "f-area" }))
    {
        <div class="f-summary">@Html.ValidationSummary()</div>

        <table width="100%" cellpadding="5" cellspacing="5" border="0">
            <tr>
                <td>
                    <label class="f-title">
                        父级：
                    </label>
                </td>
                <td>
                    <input class="f-text" autocomplete="off" name="parentName" id="parentName" value="@ViewBag.parentName" readonly="readonly" type="text" />
                    <input type="hidden" id="ParentId" name="ParentId" value="@ViewBag.ParentId" />
                </td>
            </tr>
            <tr>
                <td>
                    <label class="f-title">
                        标题：
                    </label>
                </td>
                <td>
                    <input class="f-text" autocomplete="off" type="text" maxlength="20" value="@ViewBag.Title" name="Title" placeholder="请输入标题" />
                </td>
            </tr>
            <tr>
                <td>
                    <label class="f-title">
                        关键字：
                    </label>
                </td>
                <td>
                    <input class="f-text" autocomplete="off" type="text" maxlength="20" value="@ViewBag.Key" name="Key" placeholder="格式如“[key1]|[key2]”，用于显示相关主题" />
                </td>
            </tr>
            <tr>
                <td>
                    <label class="f-title">
                        排序：
                    </label>
                </td>
                <td>
                    <input class="f-text" autocomplete="off" type="number" maxlength="20" value="@ViewBag.SortNumber" name="SortNumber" placeholder="请输入排序码，用于帮助的显示顺序" />
                </td>
            </tr>
            <tr>
                <td>
                    <label class="f-title">
                        内容：
                    </label>
                </td>
                <td>
                    <textarea id="Content" autocomplete="off" name="Content" cols="20" rows="2" class="ckeditor">@ViewBag.Content</textarea>
                </td>
            </tr>
        </table>
        <div class="f-submit-row">
            <input type="hidden" name="backurl" value="@ViewBag.backurl" />
            <input class="f-submit" type="submit" value="添加" />
            <input class="f-cancle" type="button" id="cancle" onclick="history.back();" value="返回" />
        </div>
    }
</div>
