123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- @{;
- ViewBag.Title = "表单页面";
- Layout = "~/Views/Shared/_Form.cshtml";
- }
- <script>
- var keyValue = request('keyValue');
- $(function () {
- initControl();
- });
- //初始化控件
- function initControl() {
- //获取表单
- if (!!keyValue) {
- $.SetForm({
- url: "../../BaseManage/student/GetFormJson",
- param: { keyValue: keyValue },
- success: function (data) {
- $("#form1").SetWebControls(data);
- }
- })
- }
- }
- //保存表单;
- function AcceptClick() {
- if (!$('#form1').Validform()) {
- return false;
- }
- var postData = $("#form1").GetWebControls(keyValue);
- $.SaveForm({
- url: "../../BaseManage/student/SaveForm?keyValue=" + keyValue,
- param: postData,
- loading: "正在保存数据...",
- success: function () {
- $.currentIframe().$("#gridTable").trigger("reloadGrid");
- }
- })
- }
- </script>
- <div style="margin-top: 20px; margin-right: 30px;">
- <table class="form">
- <tr>
- <td class="formTitle">姓名</td>
- <td class="formValue">
- <input id="name" type="text" class="form-control" />
- </td>
- <td class="formTitle">性别</td>
- <td class="formValue">
- <input id="sex" type="text" class="form-control" />
- </td>
- </tr>
-
- </table>
- </div>
|