#7124: Form field javascript event handler
---------------------------------------------+------------------------------
          Reporter:  MihaiD                  |         Owner:  nobody
            Status:  closed                  |     Milestone:        
         Component:  Forms                   |       Version:  SVN   
        Resolution:  wontfix                 |      Keywords:        
             Stage:  Design decision needed  |     Has_patch:  0     
        Needs_docs:  0                       |   Needs_tests:  0     
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by lukeplant):

  * status:  new => closed
  * resolution:  => wontfix

Comment:

 The "workaround" mentioned is the way that most modern javascript toolkits
 work (and similar to how Django's admin widgets work).  The "unobtrusive
 javascript" they support is superior to inline event handlers in many
 ways, but especially when you come to needing more than one event handler.
 Encouraging this way of programming seems like a step backwards,
 especially as it means you will have multiple places to look for finding
 javascript.  Using most toolkits, you would be able to hook up the event
 handlers by adding a bit of javascript code into your template with very
 little code, e.g. jQuery:

 {{{
 #!javascript
 jQuery(function(event) {
   // this function will run when the document is ready
   $("id_email").change(function () {
      // this will run when input with id = "id_email" is changed.
      // do something here
   });
 });
 }}}

 Since you can already add the "onchange" etc attributes if you really want
 to (using "attrs" as mentioned above), I'm closing as WONTFIX.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7124#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to