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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:27:28+00:00 2026-05-31T15:27:28+00:00

FYI – development site, work in progress. I am using Django on a page

  • 0

FYI – development site, work in progress.

I am using Django on a page with a form. However, I am also using a javascript tab function on this same page which highlights the tab with the correct on-page link / hash.

The default page = http://learntango.webfactional.com/video/35863752#section=comment
The contact-us page = http://learntango.webfactional.com/video/35863752#section=contact

When the form is not valid, the page is returned (good). However, it is the base page which is returned: http://learntango.webfactional.com/video/35863752

After that, the javascript then defaults this to the comment page.

How do I return the same page, with the “contact” on-page link active, so they can see their form errors and realize that the form did not submit?

Thanks!
David

def video(request, url_vimeo_id):
    if request.method == 'POST':
        form = ContactForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            send_mail(
                'This is an e-mail from the website',
                cd['message'],
                cd.get('email', 'noreply@example.com'),
                ['dwyliu@gmail.com'],
            )
            return HttpResponseRedirect('http://www.learntodancetango.com')
        return render_to_response('video.html',{'video': video,'next':next, 'form': form}, context_instance=RequestContext(request))
    else:
        form = ContactForm()
        return render_to_response('video.html',{'video': video,'next':next, 'form': form}, context_instance=RequestContext(request))
  • 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-05-31T15:27:29+00:00Added an answer on May 31, 2026 at 3:27 pm

    Set form’s action as http://learntango.webfactional.com/video/35863752#section=contact

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

Sidebar

Related Questions

I'm considering using Django for a project I'm starting (fyi, a browser-based game) and
I am having some frustrating javascript timing issues. FYI, the page is a jsp
* FYI: I'm not using Adsense and this is not against my TOS... I
This code trims whitespace, (fyi: it's credited to be very fast) function wSpaceTrim(s){ var
I am working on a FYI page that has large list of top-tiered links.
FYI, I'm working on my first MVC web application using MVC 3 and Razor
I am working on login/signup module(FYI no rolls/membership just a simple login form),data flow
FYI: If there is a better place/site (Programmer SE, for eg), feel free to
I am at my wits' end on this one. FYI, I work in infrastructure,
FYI: all work can be seen in the trac repo @ http://matthewh.me/scripts/browser/c/shared_library?order=name The original

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.