Code

Changes between Version 23 and Version 24 of AjaxDjangoDojoForm


Ignore:
Timestamp:
06/06/06 09:54:22 (8 years ago)
Author:
anonymous
Comment:

Corrected spelling...

Legend:

Unmodified
Added
Removed
Modified
  • AjaxDjangoDojoForm

    v23 v24  
    66{{{ 
    77#!html 
    8 Part 1 <br/> <a href="#P1">Ajax basic form submition, Django server answer return to Ajax call.</a><br/> 
    9 Part 2 <br/><a href="#P2">Handling the form when JavaScript is desactivated.</a> 
     8Part 1 <br/> <a href="#P1">Ajax basic form submission, Django server answers Ajax call.</a><br/> 
     9Part 2 <br/><a href="#P2">Handling the form when JavaScript is deactivated.</a> 
    1010}}} 
    1111 
     
    1313{{{ 
    1414#!html 
    15 <a name="P1"><h1>Ajax basic form submition, Django server answer return to Ajax call.</h1></a> 
    16 }}} 
    17 '''Ajax form submition using Dojo for the client side javaScript toolkit, and simpleJson for the client/server communication.''' 
    18  
    19 This will take you through all the steps required to get started and to develop a handy form submittion without reload. 
     15<a name="P1"><h1>Ajax basic form submission, Django server answers Ajax call.</h1></a> 
     16}}} 
     17'''Ajax form submission using Dojo for the client side javaScript toolkit, and simpleJson for the client/server communication.''' 
     18 
     19This will take you through all the steps required to get started and to develop a handy form submission without reload. 
    2020 
    2121 
     
    2929== What do we want to achieve == 
    3030I will use the model of my current website, a recipe one. 
    31 When a registred user see the details of a recipe, the user can mark it or update their mark by selecting a small drop down list. 
    32 But when the user clicks ok the whole page reloads. We will use some Ajax to make it transparent and for the fancy effect 
    33 we can add fading status message like "Your mark has been updated". 
    34 The select box proposes a mark from 1 to 5, it is actually a form which is sent to the server via POST, which in django link to a method 
    35 in the view.py : ''def details(request)'' which do the innerwork for the details page generation. 
     31When a registered user sees the details of a recipe, the user can rate (mark) it or update their rating (mark) by selecting a small drop down list. 
     32But when the user clicks ok the whole page reloads. We will use some Ajax to make it transparent and for fancy effect 
     33we can add a fading status message like "Your rating has been updated". 
     34The select box proposes a rating from 1 to 5, it is actually a form which is sent to the server via POST, which in django links to a method 
     35in the view.py : ''def details(request)'' which does the innerwork for the details page generation. 
    3636 
    3737 
     
    173173 
    174174To have a demo use guest as login, guest as password here [http://ozserver.no-ip.com:345] or if not working here [http://www.cefinban.net]. 
    175 Go to index and pick a recipe, update the mark. 
     175Go to index and pick a recipe, update the rating. 
    176176 
    177177You can also have a look at the screenshot here :  [http://ozserver.no-ip.com/~greg/images/ajaxdjango.png] 
     
    199199{{{ 
    200200#!html 
    201 <a name="P2"><h1>Handling the form when JavaScript is desactivated.</h1></a> 
    202 }}} 
    203 If a user has desactivated his browser javascript support, or is using a text mode browser, we need a way of making the previous marking button submit the mark to the server which should this time return an html template instead of data to the Ajax call. 
     201<a name="P2"><h1>Handling the form when JavaScript is deactivated.</h1></a> 
     202}}} 
     203If a user has deactivated his browser's javascript support, or is using a text mode browser, we need a way of making the previous rating button submit the rating to the server which should this time return an html template instead of data to the Ajax call. 
    204204 
    205205== Updating the form HTML (details.html template)== 
    206206This time we put a submit type input inside the form instead of the button type in part 1. 
    207 type="submit" as indicates its name, submits the form to the server,we will need a way of stopping this behavior using javaScript. 
     207type="submit" as indicates its name, submits the form to the server, we will need a way of stopping this behavior using javaScript. 
    208208 
    209209{{{ 
     
    258258}}} 
    259259 
    260 The dojo binding need to append a variable to the original document url, to make ajax_or_not not None. 
     260The dojo binding needs to append a variable to the original document url, to make ajax_or_not not None. 
    261261 
    262262{{{