Thanks for your shearing a good knowledge. I'll do it.
Veasna, On Thu, May 14, 2009 at 9:42 PM, zayatzz <alan.kesselm...@gmail.com> wrote: > > Im also a django beginner, but i have bit more advanced knowledge > about js/jquery > > Here's what ive learned so far: All js events happen in browser and > are all related/attached to some DOM elements. > > Basic (model)form flow works like that: > You create a model > You create a modelform (in apps forms.py for example) > You pass it to a template in a view > You load it in template with {{ from }} > > Check django forms documentation for more specific stuff. > > If you want to run some events related to form fields or when > submitting a form, then you must know how the form will look like in > markup and you can do it on template level writing stuff directly into > template or create js file that is started on jquery domready event. > That js file will catch formfield events. > > You can also create formwidgets. Not sure how to use/create them > beause so far, ive only used tinyMCE pluggable and havent created any > of my own. > > Basically i do not think django is an issue here. Just create html > file with form and then create jquery some jquery events. Adding > django into the mix changes not a thing especially if you want to use > onchange events. > > Alan > On May 14, 9:34 am, newbie <mara.ku...@gmail.com> wrote: > > hi, > > > > I'm new to django and dont know much of javascript either. I > > would like to start working on them. Could someone help me write a > > simple form which can provide any functionality using ajax, preferably > > using jquery libraries. It would be great if any event other than the > > submit event is recognised using ajax, something which connects to the > > database would be preferable. > > > > I've used ajax in web2py. But here in django I'm not able to > > understand the flow of a form. Here in django, forms are created by > > declaring a class in a seperate file. In web2py, it was clear and > > obvious of how to recognize a input or click or onchange event for a > > particular input field. But here I dont understand where to catch the > > event. Do i need to write the code in template file or in view file. > > If i write it in template file(which i'm thinking is the way), how to > > send the input entered(before the user submits the form) to the view > > file. > > > > All i want to do is, to capture a change/input event on a form > > before the user submits and dynamically create an extra field in the > > form/change the options of a field already present in the form, based > > on the input > > > > Thank you. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---