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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:06:02+00:00 2026-06-14T05:06:02+00:00

I have for tabs in a page which work with ajax. in the third

  • 0

I have for tabs in a page which work with ajax. in the third tab (compose) there is a form, i want when teh form is submitted, then we go to the first tab (inbox).enter image description here

enter image description here

I want to know how is it possible? what have i do?
i have a base.html:

{% block extrahead %}
    <script type="text/javascript">
        $( document ).ready( function() {
           $( '#inbox' ).html( '{% trans "waiting ..." %}' ).load( 'inbox/');

           $( '#inbox_list' ).click( function() {

               $( '#inbox' ).html( '{% trans "waiting ..." %}' ).load( 'inbox/');
            });
            $( '
                $( '#outbox' ).html( '{% trans "waiting ..." %}' ).load( 'outbox/');
            });
            $( '#compose_list' ).click( function() {

                $( '#compose' ).html( '{% trans "waiting ..." %}' ).load( 'compose/');
            });
            $( '#trash_list' ).click( function() {

                $( '#trash' ).html( '{% trans "waiting ..." %}' ).load( 'trash/');
            });
        });
     </script>

<div id="dRtabs">
            <ul class="tabber">
                <li><a id="inbox_list" href="#inbox">{% trans "inbox" %}</a> </li>
                <li><a id="outbox_list" href="#outbox">{% trans "sent" %}</a> </li>
                <li><a id="compose_list" href="#compose">{%  trans "compose" %}</a> </li>
                <li><a id="trash_list" href="#trash">{%  trans "trash" %}</a> </li>
            </ul>
            <div class="clear"></div>
            <div id="inbox" class="tabContent">
                loading...
            </div>
            <div id="outbox" class="tabContent">
                loading...
            </div>
            <div id="compose" class="tabContent">
                loading...
            </div>
            <div id="trash" class="tabContent">
                loading...
            </div>
    </div>

and in compose.html i have this function:

<script type="text/javascript">
        $(function() {
            alert("first");
            $('#compose_form').submit(function() {
                alert("second");
                var temp = $("#compose_form").serialize();
                $.ajax({
                    type: "POST",
                    data: temp,
                    url: 'compose/',
                    success: function(data) {
                       ???
                    }
                });
                return false;
            });
        });
    </script>

i don’t know what to do in success function.
and i have this view function for compose:

def compose(request, recipient=None):  
    if request.is_ajax():
        if request.method == "POST":
            sender = request.user
            form = ComposeForm(request.POST, recipient_filter=recipient_filter)
            if form.is_valid():
                form.save(sender=request.user)
                messages.info(request, _(u"Message successfully sent."))

                return ???
        else:
            form = ComposeForm()            
        return render_to_response('message/compose.html', {
            'form': form,
            }, context_instance=RequestContext(request))

so i want to know how to switch between these tabs and what i should return in vews.py. I really need your help. thanks
i’m using django

  • 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-14T05:06:03+00:00Added an answer on June 14, 2026 at 5:06 am

    A simple trigger would work for switching tabs.

    $('#inbox_list').trigger('click'); // .click() may also work.
    

    You would run this when the form is complete and submitted

    You can return true of false and you can check this value and if true show him the inbox page, else show him an error message.

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

Sidebar

Related Questions

I have a page where there will be many tabs and i want to
I have a page which is having 2 tabs. On first tab i have
I have an aspx page on which I have 2 static jquery tabs.Upon clicking
I have several tabs in my application, and each tab loads a different sub-page
I have a jQueryUI Tabs control on a web page. Each tab contains one
I have a page with two tabs that I want to be able to
What i have is a tabbed page with 12 tabs (every tab is a
I have the following style which works as I want it to work: .container
I have a page on which I'm using jQuery UI Tabs , what I'm
we have a wpf application..in the Home page we have Work,Help,Approve Search tabs.. When

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.