Changes between Version 11 and Version 12 of AJAX/Dojo/RefactoredFormSubmit


Ignore:
Timestamp:
02/11/2007 10:58:04 AM (8 years ago)
Author:
erob@…
Comment:

finalizing...

Legend:

Unmodified
Added
Removed
Modified
  • AJAX/Dojo/RefactoredFormSubmit

    v11 v12  
    44Here's a simple recipe that worked for me. It is quite inspired by the [wiki:AjaxDojoFormSub] example―and from [http://www.b-list.org/weblog/2006/07/31/django-tips-simple-ajax-example-part-1 this tutorial]―except that this  recipe is expected to use python-cjson for receiving JSON data.
    55
    6 My initial objective was to display validation errors without doing a page-refresh, by using JSON
    7 for carrying errors (or whatever else you could possibly imagine) back to the client browser.
     6My initial objective was to display validation errors without doing a page-refresh, by using JSON for carrying errors (or whatever else you could possibly imagine) back to the client browser.
    87
    98=== The server view ===
     
    5857}}}   
    5958
    60 The ''djConfig.isDebug'' parameter is important for debugging, so you should
     59The {{{djConfig.isDebug}}} parameter is important for debugging, so you should
    6160consider setting it to "true" when inspecting you're application with Firebug
    6261or something else.
     
    109108}}}
    110109
    111 Notice the removal of the formNode parameter for postContent, and the
    112 use of ''dojo.io.encodeForm'' to parse/encode the form data in
    113 a proper format. 
     110Notice the removal of the {{formNode}} parameter for {{postContent}}, and the
     111use of {{dojo.io.encodeForm}} to parse/encode the form data into
     112a proper format. That is all required for having the {{{XMLHTTPRequest}}}
     113object handled by the Dojo toolkit.
     114
     115To connect the input submit button with the JS callback, use the following
     116line:
     117{{{
     118#!text/html
     119<input type="button" onclick="validate()" id="fooBtn"></input>
     120}}}
     121
     122Have fun! That recipe should work in Firefox 2 and Opera 9.10.
    114123
    115124=== Limitations/Bugs ===
     
    124133=== References ===
    125134
    126 etc.
     135 * blah
    127136
    128137
Back to Top