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

Last change on this file since 200 was 200, checked in by gocher, 15 years ago

plugin Forms

textarea gets new attributes: wrap, readonly disabled, tabindex, accesskey

File size: 3.2 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_value", "f_cols", "f_rows", "f_wrap", "f_tabindex", "f_accesskey", "f_readonly", "f_disabled"];
11
12function Init() {
13  window.resizeTo(480,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]]; 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 d = document;
31        var el = d.getElementById("f_name");
32        if (!el.value) {
33        alert("You must enter a Name");
34                el.focus();
35          return false;
36        }
37  // pass data back to the calling window
38  var param = new Object();
39  for (var i in fields) {
40    switch (fields[i]) {
41    case "f_readonly":
42    case "f_disabled":
43      param[fields[i]] = document.getElementById(fields[i]).checked; break;
44    default:
45      param[fields[i]] = document.getElementById(fields[i]).value; break;
46    }
47  }
48  __dlg_close(param);
49  return false;
50};
51
52function onCancel() {
53        __dlg_close(null);
54        return false;
55};
56</script>
57</head>
58
59<body onload="Init()">
60<div id="f_type" class="title">Form Element: TEXTAREA</div>
61<form action="" method="get">
62  <div class="fr">Name/ID:</div>
63  <input type="text" name="name" id="f_name" title="name of the textarea" />
64  <p />
65  <fieldset>
66        <legend>Dimensions</legend>
67    <div class="fr">Columns:</div>
68    <input type="text" name="cols" id="f_cols" size="5" title="Width in number of characters" />
69    <p />
70    <div class="fr">Rows:</div>
71                <input type="text" name="rows" id="f_rows" size="5" title="Height in number of rows" />
72    <p />
73        </fieldset>
74  <div class="space"></div>
75  <div class="fr">Wrap Mode:</div>
76  <select name="wrap" id="f_wrap">
77    <option value=""></option>
78    <option value="off">Off</option>
79    <option value="soft">Soft</option>
80    <option value="hard">Hard</option>
81    <option value="physical">Physical</option>
82    <option value="virtual">Virtual</option>
83    <option value="normal">normal</option>
84    <option value="nowrap">nowrap</option>
85    <option value="pre">pre</option>   
86  </select>
87  <p />
88  <div class="fr">Read Only</div>
89  <input type="checkbox" name="readonly" id="f_readonly" value="readonly" />
90  <p />
91  <div class="fr">Disabled</div>
92  <input type="checkbox" name="disabled" id="f_disabled" value="disabled" />
93  <p />
94  <div class="fr">Tab Index:</div>
95  <input type="text" name="tabindex" id="f_tabindex" />
96  <p />
97  <div class="fr">Access Key:</div>
98  <input type="text" name="accesskey" id="f_accesskey" />
99  <p />
100 
101  <div class="fr">Initial Text:</div>
102  <input type="text" name="value" id="f_value" title="Default text (optional)" />
103  <div id="buttons">
104    <button type="button" name="ok" onclick="return onOK();">OK</button>
105    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
106  </div> 
107</form>
108
109</body>
110</html>
Note: See TracBrowser for help on using the repository browser.