source: trunk/plugins/Forms/popups/form.html @ 191

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

new plugin forms

File size: 2.0 KB
Line 
1<html>
2
3<head>
4  <title>Insert/Edit Form</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">
9function Init() {
10  window.resizeTo(400, 170);
11  __dlg_translate("Forms");
12        __dlg_init();
13  var param = window.dialogArguments;
14  document.getElementById("f_name").value = param.f_name;
15  document.getElementById("f_action").value = param.f_action;
16  document.getElementById("f_method").value = param.f_method;
17        document.getElementById("f_name").focus();
18};
19
20function onOK() {
21  var required = {
22    "f_name": "You must enter the form name"
23  };
24  for (var i in required) {
25          var el = document.getElementById(i);
26          if (!el.value) {
27                alert(required[i]);
28                el.focus();
29                return false;
30          }
31  }
32  // pass data back to the calling window
33  var fields = ["f_name", "f_action", "f_method"];
34  var param = new Object();
35  for (var i in fields) {
36    var id = fields[i];
37        var el = document.getElementById(id);
38    param[id] = el.value;
39  }
40  __dlg_close(param);
41  return false;
42};
43
44function onCancel() {
45  __dlg_close(null);
46  return false;
47};
48</script>
49</head>
50
51<body onload="Init()">
52<div class="title">Form</div>
53<form action="" method="get">
54  <div class="fr">Form Name:</div>
55  <input type="text" name="name" id="f_name" size="20" title="Name" />
56  <p />
57
58  <fieldset>
59  <legend>Form handler script</legend>
60  <div class="space"></div>
61  <div class="fr">Script URL:</div>
62  <input name="action" id="f_action" type="text" size="30">
63  <p />
64  <div class="fr">Method:</div>
65  <select name="f_method" id="f_method">
66    <option value=""></option>
67    <option value="post">Post</option>
68    <option value="get">Get</option>
69  </select>
70  <div class="space"></div>
71  </fieldset>
72
73<div id="buttons">
74  <button type="button" name="ok" onclick="return onOK();">OK</button>
75  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
76</div>
77</form>
78
79</body>
80</html>
Note: See TracBrowser for help on using the repository browser.