Form.cshtml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. @{
  2. ViewBag.Title = "Form";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var keyValue = request('keyValue');
  7. //获取表单
  8. //if (!!keyValue) {
  9. // $.SetForm({
  10. // url: "../../CustomerManage/Customer/GetFormJson",
  11. // param: { keyValue: keyValue },
  12. // success: function (data) {
  13. // $("#form1").SetWebControls(data);
  14. // $("#Province").trigger("change"); $("#City").ComboBoxSetValue(data.City)
  15. // }
  16. // })
  17. //}
  18. //保存表单;
  19. function AcceptClick() {
  20. if (!$('#form1').Validform()) {
  21. return false;
  22. }
  23. var postData = $("#form1").GetWebControls(keyValue);
  24. $.SaveForm({
  25. url: "../../WarehouseManage/CalculateUnit/SaveCulcalateUnit",
  26. param: postData,
  27. loading: "正在保存数据...",
  28. success: function () {
  29. $.currentIframe().$("#gridTable").trigger("reloadGrid");
  30. }
  31. })
  32. }
  33. </script>
  34. <div style="margin-top: 20px; margin-right: 30px;">
  35. <table id="form1" class="form">
  36. <tr>
  37. <td class="formTitle">编号<font face="宋体">*</font></td>
  38. <td class="formValue">
  39. <input id="Code" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
  40. </td>
  41. </tr>
  42. <tr>
  43. <td class="formTitle">计量单位<font face="宋体">*</font></td>
  44. <td class="formValue">
  45. <input id="CalculateUnit" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
  46. </td>
  47. </tr>
  48. </table>
  49. </div>