cool_textarea.aspx
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" %>
  2. <html>
  3. <head>
  4. <title>多行输入框设定</title>
  5. <script>
  6. function my_submit()
  7. {
  8.   if(ITEM_NAME.value=="")
  9.   {
  10.      alert("控件名称不能为空");
  11.      return;
  12.   }
  13.   if(edit_flag==0)
  14.   {
  15.      var parent_window = parent.dialogArguments;
  16.      control_html="<textarea rows=5 cols=50 title=""+ITEM_NAME.value.replace(""","&quot;")+"" style="font-size:"+ITEM_SIZE.value+"">"+ITEM_VALUE.value+"</textarea>";
  17.      parent_window.EDIT_HTML.insertHtml(control_html);
  18.   }
  19.   else
  20.   {
  21.      oSelection = dialogArguments.document.selection.createRange();
  22.      sRangeType = dialogArguments.document.selection.type;
  23.      if (sRangeType == "Control")
  24.      {
  25.     oSelection(0).title = ITEM_NAME.value;
  26.     oSelection(0).value = ITEM_VALUE.value;
  27.     oSelection(0).style.fontSize = ITEM_SIZE.value;
  28.       }
  29.   }
  30.   window.close();
  31. }
  32. //-- 获取控件属性 --
  33. var edit_flag=0;
  34. function LoadDo()
  35. {
  36.   oSelection = dialogArguments.document.selection.createRange();
  37.   sRangeType = dialogArguments.document.selection.type;
  38.   if (sRangeType == "Control")
  39.   {
  40.    edit_flag=1;
  41.    ITEM_NAME.value = oSelection(0).title;
  42.    ITEM_VALUE.value = oSelection(0).value;
  43.    ITEM_SIZE.value = oSelection(0).style.fontSize.replace("px","");
  44.   }
  45.   ITEM_NAME.focus();
  46. }
  47. </script>
  48. </head>
  49. <body topmargin="0" onload="LoadDo();">
  50. <table border="0" cellspacing="1" width="100%" class="small" bgcolor="#ffffff" cellpadding="3"
  51. align="center">
  52. <tr class="TableContent">
  53. <td nowrap>控件名称:
  54. </td>
  55. <td nowrap>
  56. <Input name="ITEM_NAME" type="text" class="SmallInput" size="20">
  57. </td>
  58. </tr>
  59. <tr class="TableContent">
  60. <td nowrap>默认值:
  61. </td>
  62. <td nowrap>
  63. <Input name="ITEM_VALUE" type="text" class="SmallInput" size="20">
  64. </td>
  65. </tr>
  66. <tr class="TableContent">
  67. <td nowrap>字体大小:
  68. </td>
  69. <td nowrap>
  70. <Input name="ITEM_SIZE" type="text" class="SmallInput" size="20" title="可选,默认13像素">
  71. </td>
  72. </tr>
  73. <tr>
  74. <td class="TableControl" colspan="2" align="center">
  75. <input type="submit" onclick="my_submit();" value="确 定" class="SmallButton">
  76. </td>
  77. </tr>
  78. </table>
  79. </body>
  80. </html>