Hi, I had the same problem, my solution was overwrite the as_p function for my form class, and I changed the last line:
mark_safe('\n'.join(output)) --> mark_safe('\n'.join(output).replace(''',"'")) Mijail El jueves, 9 de julio de 2009 16:15:16 UTC-5, Tim Sawyer escribió: > > Hi, > > I'd like to add an onkeyup event on a form field. I've defined the > following in > my form: > > contest = forms.CharField(max_length=100, > widget=forms.TextInput(attrs={"onkeyup" : > "lookup(this.value,'id_contest');",} ) > ) > > This comes out as > > <input onkeyup="lookup(this.value,'id_contest');" id="id_contest" > type="text" name="contest" maxlength="100" /> > > in the html. How do I stop django auto-escaping my javascript and > replacing a > single quote with #39; ? > > Thanks, > > Tim. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.