source: trunk/plugins/Forms/popups/textarea.html @ 254

Last change on this file since 254 was 254, checked in by gocher, 14 years ago

Workaround for removeAttribute() and setAttribute()
problems with IE

for Example
object.setAttribute("readOnly",true) in IE
object.setAttribute("readOnly","readOnly") in Mozilla

File size: 3.4 KB
Line 
1<html>
2
3<head>
4  <title>Insert/Edit Form Element TEXTAREA</title>
5  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
6  <script type="text/javascript" src="../../../popups/popup.js"></script>
7
8<script type="text/javascript">
9
10var fields = ["f_name", "f_text", "f_cols", "f_rows", "f_wrap", "f_tabindex", "f_accesskey", "f_readOnly", "f_disabled"];
11
12function Init() {
13  window.resizeTo(280,260);
14  __dlg_translate("Forms");
15        __dlg_init();
16        var param = window.dialogArguments;
17  for (var i in fields) {
18    switch (fields[i]) {
19    case "f_readOnly":
20    case "f_disabled":
21      document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true);  break;
22    default:
23      document.getElementById(fields[i]).value = param[fields[i]]; break;
24    }
25  }
26  document.getElementById("f_name").focus();
27};
28
29function onOK() {
30        var el = document.getElementById("f_name");
31        if (!el.value) {
32        alert("You must enter a Name");
33                el.focus();
34          return false;
35        }
36  // pass data back to the calling window
37  var param = new Object();
38  for (var i in fields) {
39    switch (fields[i]) {
40    case "f_readOnly":
41    case "f_disabled":
42      if(HTMLArea.is_ie)
43        param[fields[i]] = (document.getElementById(fields[i]).checked)?true:"";
44      else
45        param[fields[i]] = (document.getElementById(fields[i]).checked)?fields[i].substring(2,20):"";
46      break;
47    default:
48      param[fields[i]] = document.getElementById(fields[i]).value; break;
49    }
50  }
51  __dlg_close(param);
52  return false;
53};
54
55function onCancel() {
56        __dlg_close(null);
57        return false;
58};
59</script>
60</head>
61
62<body class="dialog" onload="Init()">
63<div id="f_type" class="title">Form Element: TEXTAREA</div>
64<form action="" method="get">
65  <div class="fr">Name/ID:</div>
66  <input type="text" name="name" id="f_name" title="name of the textarea" />
67  <p />
68  <fieldset>
69        <legend>Dimensions</legend>
70    <div class="fr">Columns:</div>
71    <input type="text" name="cols" id="f_cols" size="5" title="Width in number of characters" />
72    <p />
73    <div class="fr">Rows:</div>
74                <input type="text" name="rows" id="f_rows" size="5" title="Height in number of rows" />
75    <p />
76        </fieldset>
77  <div class="space"></div>
78  <div class="fr">Wrap Mode:</div>
79  <select name="wrap" id="f_wrap">
80    <option value=""></option>
81    <option value="off">Off</option>
82    <option value="soft">Soft</option>
83    <option value="hard">Hard</option>
84    <option value="physical">Physical</option>
85    <option value="virtual">Virtual</option>
86    <option value="normal">normal</option>
87    <option value="nowrap">nowrap</option>
88    <option value="pre">pre</option>   
89  </select>
90  <p />
91  <div class="fr">Read Only</div>
92  <input type="checkbox" name="readOnly" id="f_readOnly" value="readOnly" />
93  <p />
94  <div class="fr">Disabled</div>
95  <input type="checkbox" name="disabled" id="f_disabled" value="disabled" />
96  <p />
97  <div class="fr">Tab Index:</div>
98  <input type="text" name="tabindex" id="f_tabindex" />
99  <p />
100  <div class="fr">Access Key:</div>
101  <input type="text" name="accesskey" id="f_accesskey" />
102  <p />
103 
104  <div class="fr">Initial Text:</div>
105  <input type="text" name="text" id="f_text" title="Default text (optional)" />
106  <div id="buttons">
107    <button type="button" name="ok" onclick="return onOK();">OK</button>
108    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
109  </div> 
110</form>
111
112</body>
113</html>
Note: See TracBrowser for help on using the repository browser.