Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8141157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:24:33+00:00 2026-06-06T12:24:33+00:00

When I click the button and the form is valid it just refreshes the

  • 0

When I click the button and the form is valid it just refreshes the page. I checked the POST data it is correct. What can be the problem?

I have a different contact form with the same setup, and it works.

The forms.py file:

class ContactFormDebate(forms.Form):

subject = forms.CharField(max_length=100)
debate_title = forms.CharField(max_length=100)
debate_description = forms.CharField()
debate_scope = forms.CharField(max_length=200)
sender = forms.EmailField()
cc_myself = forms.BooleanField(required=False)

views.py:

def contactDebate(request):
if request.method == 'POST': # If the form has been submitted...
    form = ContactFormDebate(request.POST) # A form bound to the POST data
    if form.is_valid():
        subject = form.cleaned_data['subject']
        debate_title = form.cleaed_data['debate_title']
        debate_description = form.cleaned.data['debate_description']
        sender = form.cleaned_data['sender']
        cc_myself = form.cleaned_data['cc_myself']

        recipients = ['someemail@email.com']
        if cc_myself:
            recipients.append(sender)

        from django.core.mail import send_mail
        message = debate_title.append(debate_descripton)
        send_mail(subject, message, sender, recipients)
        return HttpResponseRedirect('/thanks/') # Redirect after POST
else:
    form = ContactFormDebate() # An unbound form

return render(request, 'newdebate.html', {
    'form': form,
})

template:

<h2 class="page-heading"><span>ПОДНЕСИ НОВА ДЕБАТА</span></h2>
<form action="." method="post">{% csrf_token %}
{{ form.non_field_errors }}
<div class="fieldWrapper">
    {{ form.subject.errors }}
    <label for="id_subject">Наслов на пораката:</label>
    {{ form.subject }}
</div>
<div class="fieldWrapper">
    {{ form.debate_title.errors }}
    <label for="id_debate_title">Наслов на дебатата:</label>
    {{ form.debate_title }}
</div>
<div class="fieldWrapper">
    {{ form.debate_description.errors }}
    <label for="id_debate_description">Опис на дебатата:</label>
    {{ form.debate_description }}
</div>
<div class="fieldWrapper">
    {{ form.sender.errors }}
    <label for="id_sender">Email адреса:</label>
    {{ form.sender }}
</div>
<div class="fieldWrapper">
    {{ form.cc_myself.errors }}
    {{ form.cc_myself }}
    <label for="id_cc_myself" id="myself">Сакам да ми пристигне копија од пораката</label>
</div>
<p>
<div style="clear: both;"></div>
<input type="submit" value="Испрати" class="btn1 btn-primary1" /></p>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:24:35+00:00Added an answer on June 6, 2026 at 12:24 pm

    You’re missing a field for debate_scope in your HTML.

    Also, you have typos for the correct case: cleaed_data, cleaned.data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I validate a form on button click without submitting the whole form using
I have a form which I want to submit upon button click which is
I have an ASP.NET form (C#) but which I click this button that should
I have form with 1 button. when you click on the button 3 others
I have a page with some dynamically added buttons. If you click a button
I have form where before i was using simple post with <button name=submit id=register
I'm developing a dynamic form where a user can click a button, and then
I want to click a button on my access form that opens a folder
When click a button,I want to popup a view form bottom,like this! Any help
I want to be able to click a button and open a new form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.