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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:43:19+00:00 2026-06-09T20:43:19+00:00

I have found this great code snippets on this blog to change the language

  • 0

I have found this great code snippets on this blog to change the language selector for something more stylish. (Twitter-bootstrap in mind)

It looks pretty neat, however when I actually click on the selection, nothing is submitted on onclick. I am not yet an expert in jquery, but could something have been deprecated in latest 1.8.0 version that stops the onclick from working?

<form name="setLang{{ lang.1}}" action="/i18n/setlang/" method="POST">{% csrf_token %}
   <input name="next" type="hidden" value="{{ redirect_to }}" />
   <input type="hidden" name="language" value="{{ lang.0 }}" />
   <a href="#" onclick="document.setLang{{ lang.1 }}.submit(); return false;">{{ lang.1 }}</a>
</form>
  • 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-09T20:43:21+00:00Added an answer on June 9, 2026 at 8:43 pm

    You can’t use document.setLang{{ lang.1 }} to get the form. That’s not a valid name for a DOM element. JavaScript will break processing at the first whitespace it encounters, and throw an error.

    I strongly suggest you use a valid name value, but if you really need to keep using that, you can access the element with document.getElementsByName("setLang{{ lang.1}}")[0].submit().​​​​

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

Sidebar

Related Questions

I have just found this great tutorial as it is something that I need.
I have found this great gant script on http://blog.armbruster-it.de/2010/07/getting-a-list-of-all-i18n-properties-used-in-a-grails-application/ Thanks Stefan! Description: create a
I have found many great answers to this from a year ago (when it
I have found this line of MatLab code on the internet that displays a
I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code
I have found this code for reverse geocoding: var point = new GLatLng (lat[1],long[1]);
I have found this line of code in a game that I study int
I have found this macro while digging in the source code of tweejump game.
I have found great jQuery wizard here Jerod Santo blog which suits my need.
I have found this great tutorial, about uploading files with a Flex app, using

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.