JavaScript function calls within Django form fields -


i'd create form have checkboxes, , when clicked, open separate textareas user enter more information in.

if want use django's dynamically created form fields, there way can put function call in each checkbox.

you can dynamically add event handlers using javascript. can add script that, once page loaded, find checkboxes want , add handlers there. in jquery, can write this:

$(document).ready(function() {     $(".my_form input[type=checkbox]").change(function() {           //some code here     }); }); 

be careful, have not tested code above! should enough started.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -