Opened 9 years ago

Last modified 9 years ago

#25766 closed Bug

adding javascript "this.disabled" invalidate ManyToManyField — at Initial Version

Reported by: liwee Owned by: nobody
Component: contrib.admin Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


With just and, I was able to save a poll without any problems.
But if you add onClick="this.disabled=true; this.form.submit()", trying to save the poll will cause a problem.


{% if show_save_and_continue %}<input onClick="this.disabled=true; this.form.submit();" type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" />{% endif %}

from django.db import models

class Question(models.Model):
    qn = models.CharField(max_length=200)

    def __unicode__(self):
        return self.qn
class Poll(models.Model):
    name = models.CharField(max_length=200)
    qn = models.ManyToManyField(Question)

from django.contrib import admin
from .models import *

class PollAdmin(admin.ModelAdmin):
	filter_horizontal = ('qn',), PollAdmin)

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top