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

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

plugin form:
changes Form dialog, add Encoding and Target Frame

File size: 2.5 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_enctype").value = param.f_enctype;
18  document.getElementById("f_target").value = param.f_target;
19        document.getElementById("f_name").focus();
20};
21
22function onOK() {
23  var required = {
24    "f_name": "You must enter the form name"
25  };
26  for (var i in required) {
27          var el = document.getElementById(i);
28          if (!el.value) {
29                alert(required[i]);
30                el.focus();
31                return false;
32          }
33  }
34  // pass data back to the calling window
35  var fields = ["f_name", "f_action", "f_method", "f_enctype", "f_target"];
36  var param = new Object();
37  for (var i in fields) {
38    var id = fields[i];
39        var el = document.getElementById(id);
40    param[id] = el.value;
41  }
42  __dlg_close(param);
43  return false;
44};
45
46function onCancel() {
47  __dlg_close(null);
48  return false;
49};
50</script>
51</head>
52
53<body onload="Init()">
54<div class="title">Form</div>
55<form action="" method="get">
56  <div class="fr">Form Name:</div>
57  <input type="text" name="name" id="f_name" size="20" title="Name" />
58  <p />
59
60  <fieldset>
61  <legend>Form handler script</legend>
62  <div class="space"></div>
63  <div class="fr">Action URL:</div>
64  <input name="action" id="f_action" type="text" size="30">
65  <p />
66  <div class="fr">Method:</div>
67  <select name="f_method" id="f_method">
68    <option value=""></option>
69    <option value="post">Post</option>
70    <option value="get">Get</option>
71  </select>
72  <div class="space"></div>
73  <div class="fr">Encoding:</div>
74  <select name="enctype" id="f_enctype">
75    <option value=""></option>
76    <option value="application/x-www-form-urlencoded">HTML-Form to CGI (default)</option>
77    <option value="multipart/form-data">multipart Form Data (File-Upload)</option>
78  </select>
79  <p />
80  <div class="fr">Target Frame:</div>
81  <input name="target" id="f_target" type="text" size="30">
82  <p /> 
83  </fieldset>
84
85<div id="buttons">
86  <button type="button" name="ok" onclick="return onOK();">OK</button>
87  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
88</div>
89</form>
90
91</body>
92</html>
Note: See TracBrowser for help on using the repository browser.