Changeset 7078
- Timestamp:
- 06/22/07 14:07:26 (1 year ago)
- Files:
-
- spinoffs/prototype/branches/form/test/unit/form.html (modified) (4 diffs)
- spinoffs/prototype/branches/form/TODO (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinoffs/prototype/branches/form/test/unit/form.html
r7073 r7078 27 27 <div>This is not a form element</div> 28 28 <input type="text" name="val2" id="input_disabled" disabled="disabled" value="5" /> 29 <input type="submit" /> 29 <input type="submit" name="first_submit" value="Commit it!" /> 30 <input type="submit" name="second_submit" value="Delete it!" /> 30 31 <input type="text" name="action" value="blah" /> 31 32 </form> … … 311 312 var form = $('form'); 312 313 [form.getInputs(), Form.getInputs(form)].each(function(inputs){ 313 assertEqual(inputs.length, 4);314 assertEqual(inputs.length, 5); 314 315 assert(inputs instanceof Array); 315 316 assert(inputs.all(function(input) { return (input.tagName == "INPUT"); })); … … 348 349 // Checks that disabled element is not included in serialized form. 349 350 $('input_enabled').enable(); 350 assertHashEqual({ val1:4, action:'blah' }, $('form').serialize(true)); 351 assertHashEqual({ 352 val1:4, action:'blah', 353 first_submit:'Commit it!', second_submit:'Delete it!' 354 }, 355 $('form').serialize(true)); 351 356 352 357 // should not eat empty values for duplicate names … … 392 397 request = $("form").request(); 393 398 assert($("form").hasAttribute("method")); 394 assert(request.url. endsWith("fixtures/empty.js?val1=4&action=blah"));399 assert(request.url.include("fixtures/empty.js?val1=4")); 395 400 assertEqual("get", request.method); 396 401 397 402 request = $("form").request({ method: "put", parameters: {val2: "hello"} }); 398 403 assert(request.url.endsWith("fixtures/empty.js")); 399 assertHashEqual({ val1:4, action:'blah', val2:'hello' }, request.options.parameters); 404 assertEqual(4, request.options.parameters['val1']); 405 assertEqual('hello', request.options.parameters['val2']); 400 406 assertEqual("post", request.method); 401 407 assertEqual("put", request.parameters['_method']); spinoffs/prototype/branches/form/TODO
r6609 r7078 1 1 * [done] Form.Element.setValue (r6526:6530 fixes #5902) 2 * findFirstElement takes tabindexes into account: #7595 3 * is #3065 (findFirstElement) something the framework should care about? 4 * #6301 (filter for serialize) is not a bad idea (use cases come to mind)! 2 * [done] findFirstElement takes tabindexes into account (r6628 fixes #7595) 3 * [wontfix] is #3065 (findFirstElement) something the framework should care about? 5 4 * Ability to intercept serialization for individual elements 6 * fix #5031: Form.serialize with multiple submit buttons 7 related: review #8211 5 * fix #5031: Form.serialize with multiple submit buttons (related: #8211) 8 6 * research if #6326 (selectedIndex changes on hover) can be fixed 9 7 * #7909 (application/xhtml+xml) is a blocker (is this a DOM extensions issue??) … … 15 13 Selection notes: 16 14 15 * http://developer.mozilla.org/en/docs/DOM:window.getSelection 16 * http://developer.mozilla.org/en/docs/DOM:Selection 17 17 18 if (!document.getSelection) { 18 19 if (document.selection) … … 22 23 } 23 24 24 * http://developer.mozilla.org/en/docs/DOM:window.getSelection 25 * http://developer.mozilla.org/en/docs/DOM:Selection 25 // from Proto unit tests: Firefox, IE, and Safari 2+ 26 function getSelection(element){ 27 try { 28 if (typeof element.selectionStart == 'number') { 29 return element.value.substring(element.selectionStart, element.selectionEnd); 30 } else if (document.selection && document.selection.createRange) { 31 return document.selection.createRange().text; 32 } 33 } 34 catch(e){ return null } 35 }