Changes between Version 17 and Version 18 of AJAX/Dojo/RefactoredFormSubmit
- Timestamp:
- Feb 16, 2007, 8:02:04 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AJAX/Dojo/RefactoredFormSubmit
v17 v18 121 121 }}} 122 122 123 Notice the absence of the {{{formNode}}} param for {{{postContent}}}, and the presence of {{{dojo.io.encodeForm}}} to parse/encode the form data into 124 a proper format. That is all required for having the {{{XMLHTTPRequest}}} 125 object handled by the Dojo toolkit. 126 127 To connect the input submit button with the JS callback, use the following 128 line: 129 {{{ 130 #!text/html 131 <input type="button" onclick="validate()" id="fooBtn"></input> 132 }}} 123 Notice the absence of the {{{formNode}}} param for {{{postContent}}}, and the presence of {{{dojo.io.encodeForm}}} to parse/encode the form data into a proper format. That is more than sufficient for validating the 124 form with a {{{XMLHTTPTransport}}}. However, this approach doesn't work with file-uploads. To have file-uploads, 125 you could however change the {{{transport}}} line to {{{IframeTransport}}}. Here's a link to the [http://dojotoolkit.org/api/?#dojo.io.IframeTransport IframeTransport api]. 133 126 134 127 Have fun! That recipe should work in Firefox 2 and Opera 9.10. … … 137 130 138 131 * Usability issues: HTML 4.01 vs XHTML 1.0 strict vs No javascript 139 * How to display other mimetype(s) when JSON is not used?132 * XMLHTTPTransport doesnt support file-uploading. 140 133 141 134 === Notes === … … 147 140 * [http://cheeseshop.python.org/pypi/python-cjson/ python-cjson] 148 141 * [http://dojotoolkit.org/ Dojo, the Javascript Toolkit] 142 * [http://dojotoolkit.org/api/ Dojo API Reference] 149 143 * [http://www.w3.org/TR/html401/ HTML 4.01 Specification] 150 144 * [http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference Core Javascript 1.5 Reference (mozilla)] 151 145 * [http://www.opera.com/docs/specs/opera9/js/ecma/ ECMAScript support in Opera 9] 152 146 153 147 === Author === 148 149 Etienne Robillard <erob@cpan.org> 154 150 155 151