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 8960023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:34:45+00:00 2026-06-15T15:34:45+00:00

I have a django app where user can submit a form .I have put

  • 0

I have a django app where user can submit a form .I have put this form inside a div (say of id='mydiv_id') which is initially invisible(by css display:none).When a user want to enter the input ,he clicks a show button on the page ,and a javascript makes the div visible by making display:block.

The fields in the form have {{myform.myfield.errors}} so that a ul class="errorlist" will be created if validation fails.

I want to keep the form visible by running another javascript if the form validation fails.The body of javascript will be just $('#mydiv_id').show();

But how should I make this run? How do you tell the javascript that django form validation failed without doing the validation inside the javascript?

I think I need to put the following in javascript body..Other than that I can’t figure out how to tell it that form submission failed.

$(document).ready(function(){

..
});
  • 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-15T15:34:46+00:00Added an answer on June 15, 2026 at 3:34 pm

    if i understand you well

    $(document).ready(function(){
        show = {% if form.errors %} true {% else %} false {% endif %}
        if (show) {
           $('#mydiv_id').show();
        }
        else {
        ....
        }
    
    )};
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page which displays a form that a logged-in user can use
I have a Django app which when presented with some user error (i.e URL
In my django app, a Task can have PENDING or FINISHED status .Which is
I have created a django application. Using this app users can be created or
I have a Django app that use a django-tagging. I need to port this
I have a django app which is used for managing registrations to a survey.
I have a Django app which uses LDAP as the authentication backend. I'm not
I'm trying to create a Django app where the user can make a list
I have a form in my Django app (not in admin) that allows staff
I've installed this django-contact-form app. When I want to send an email to my

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.