Changeset 199
- Timestamp:
- 05/25/05 09:14:49 (8 years ago)
- Location:
- trunk/plugins/Forms
- Files:
-
- 2 modified
-
forms.js (modified) (3 diffs)
-
popups/form.html (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/Forms/forms.js
r191 r199 82 82 this.value = value; 83 83 } 84 function setAttr(el, attr, value) { 85 if (value != "") 86 el.setAttribute(attr, value); 87 else 88 el.removeAttribute(attr); 89 } 84 90 var outparam = new Object(); 85 91 var type = button_id; … … 100 106 outparam.f_name = frm.name; 101 107 outparam.f_action = frm.action; 102 outparam.f_method = frm.metho; 108 outparam.f_method = frm.method; 109 outparam.f_enctype = frm.enctype; 110 outparam.f_target = frm.target; 103 111 } else {; 104 112 outparam.f_name = ""; 105 113 outparam.f_action = ""; 106 outparam.f_method = ""; 114 outparam.f_method = ""; 115 outparam.f_enctype = ""; 116 outparam.f_target = ""; 107 117 } 108 118 editor._popupDialog("plugin://Forms/form", function(param) { … … 110 120 if(frm) { 111 121 frm.name = param["f_name"]; 112 frm.action = param["f_action"]; 113 frm.method = param["f_method"]; 122 setAttr(frm, "action", param["f_action"]); 123 setAttr(frm, "method", param["f_method"]); 124 setAttr(frm, "enctype",param["f_enctype"]); 125 setAttr(frm, "target", param["f_target"]); 114 126 } else { 115 editor.surroundHTML('<form name="' + param["f_name"] + '"' + 116 ' action="' + param["f_action"] + '"' + 117 ' method="' + param["f_method"] + '">', 118 ' </form>'); 127 frm = '<form name="' + param["f_name"] + '"'; 128 if (param["f_action"] != "") frm += ' action="' + param["f_action"] + '"'; 129 if (param["f_method"] != "") frm += ' method="' + param["f_method"] + '"'; 130 if (param["f_enctype"] != "") frm += ' enctype="' + param["f_enctype"] + '"'; 131 if (param["f_target"] != "") frm += ' target="' + param["f_target"] + '"'; 132 frm += '>'; 133 editor.surroundHTML(frm, ' </form>'); 119 134 } 120 135 } -
trunk/plugins/Forms/popups/form.html
r191 r199 15 15 document.getElementById("f_action").value = param.f_action; 16 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; 17 19 document.getElementById("f_name").focus(); 18 20 }; … … 31 33 } 32 34 // pass data back to the calling window 33 var fields = ["f_name", "f_action", "f_method" ];35 var fields = ["f_name", "f_action", "f_method", "f_enctype", "f_target"]; 34 36 var param = new Object(); 35 37 for (var i in fields) { … … 59 61 <legend>Form handler script</legend> 60 62 <div class="space"></div> 61 <div class="fr"> ScriptURL:</div>63 <div class="fr">Action URL:</div> 62 64 <input name="action" id="f_action" type="text" size="30"> 63 65 <p /> … … 69 71 </select> 70 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 /> 71 83 </fieldset> 72 84
