source: releases/0.91beta/plugins/Forms/popups/form.html @ 652

Last change on this file since 652 was 652, checked in by ray, 13 years ago

release 0.91beta with changed namespace

File size: 2.3 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">
9
10var fields = ["f_name", "f_action", "f_method", "f_enctype", "f_target"];
11
12function Init() {
13  window.resizeTo(400, 170);
14  __dlg_translate("Forms");
15        __dlg_init();
16  var param = window.dialogArguments;
17  for (var i in fields) {
18    document.getElementById(fields[i]).value = param[fields[i]];
19  }
20        document.getElementById("f_name").focus();
21}
22
23function onOK() {
24  var required = {
25    "f_name": "You must enter the form name"
26  };
27  for (var i in required) {
28          var el = document.getElementById(i);
29          if (!el.value) {
30                alert(required[i]);
31                el.focus();
32                return false;
33          }
34  }
35  // pass data back to the calling window
36  var param = new Object();
37  for (var i in fields) {
38    param[fields[i]] = document.getElementById(fields[i]).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 class="dialog" 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">Action 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  <div class="fr">Encoding:</div>
72  <select name="enctype" id="f_enctype">
73    <option value=""></option>
74    <option value="application/x-www-form-urlencoded">HTML-Form to CGI (default)</option>
75    <option value="multipart/form-data">multipart Form Data (File-Upload)</option>
76  </select>
77  <p />
78  <div class="fr">Target Frame:</div>
79  <input name="target" id="f_target" type="text" size="30">
80  <p /> 
81  </fieldset>
82
83<div id="buttons">
84  <button type="button" name="ok" onclick="return onOK();">OK</button>
85  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
86</div>
87</form>
88
89</body>
90</html>
Note: See TracBrowser for help on using the repository browser.