-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Django-formset - i am facing the issue - Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON #28
Comments
seems that you're interpreting HTML as JSON. A bug report like this, without any context is quite useless for me. |
Why didn't you use widget Anyway, that doesn't seem to be the problem, I just tested with the example https://github.com/jrief/django-formset/blob/main/testapp/forms/state.py and everything works fine for me. |
I didn't use I found the issue here to be from my source code If ever someone would encounter this problem, please ensure that the view you are inheriting also inherits since in my sourcecode I did this implementation: from formset.views import FormViewMixin
from .forms import ScholarshipForm
class ScholarshipCreateView(..., FormViewMixin, CreateView):
form_class = ScholarshipForm It was not able to properly process the form using the A question for @jrief, is it possible for Thanks you still for your assistance! Will continue to support your library and try to report or debug any vulnerabilities as I hope for further development of this library :) |
|
i am facing the following error in my modelchoice control change event
Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
MY CODE
my model
class Places(models.Model):
placename = models.CharField(max_length=50,unique=True)
blockname = models.CharField(max_length=50)
pincode = models.CharField(max_length=6)
TALUKNAME = models.CharField(max_length=50)
rev_dist = models.ForeignKey(REVDISTDET, on_delete=models.CASCADE, verbose_name='REVENUE DISTRICT',default='',null=True, )
edn_dist = models.ForeignKey(EDNDISTDET, on_delete=models.CASCADE, verbose_name='REVENUE DISTRICT',default='',null=True, )
class Officedet(models.Model):
my form
class OfficedetForm(forms.ModelForm):
"office_name",
"office_mail",
"office_place",
"office_gender_type",
"office_mgnt_type",
"office_class_level",
"office_type",
'office_tanno',
'office_udisecode',
"office_logo",
]
My view
class OfficeDetailCreateView(AdminUserTypeAuthMixin,FileUploadMixin, FormViewMixin, LoginRequiredMixin, CreateView):
model = Officedet
template_name = 'home/crud/crud_template.html'
form_class = OfficedetForm
success_url = reverse_lazy('office_list_view') # or whatever makes sense
extra_context = {
'pagetitle':'Office Creation'
}
my template
{% extends "layouts/masterpage-formset.html" %}
{% block pagecontent %}
{% load render_form from formsetify %}
{% render_form form %}
The text was updated successfully, but these errors were encountered: