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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:24:52+00:00 2026-06-03T12:24:52+00:00

Edit: solved by linking the correct version of jquery I have a web application

  • 0

Edit: solved by linking the correct version of jquery
I have a web application built with django. I have Search page that uses jquery to show the results without refreshing the page. I want to use collapsable on the search results but it doesn’t work.
Here is the code, /query renders results.html.
Search.html:

{% extends "base.html" %}
{% block nav3 %}class="active"{% endblock %}
{% block container %}
<script type="text/javascript">
$(document).ready(function() {
    $("#exec").click(function() {
            var dataString = 'arg1='+ $("input#arg1").val() + '&rel=' + $("input#rel").val() + '&arg2=' + $("input#arg2").val();  
            //alert (dataString);return false;  
            $.ajax({  
                type: "GET",  
                url: "/query",  
                data: dataString,  
                success: function(data) {  
                    $(".res").html(data)
                }  
            });  
            return false; 
  });
});

</script>
<form class="form-horizontal">
    <fieldset>
          <legend>Search Relations</legend>
            <div class="control-group">
                <label class="control-label">   Argument1 </label>
                <div class="controls"><input id="arg1" name="arg1" size="30" type="text"/><br /></div>
                <label class="control-label">   Relation </label>
                    <div class="controls"><input id="rel" name="rel" size="30" type="text" /><br /></div>
                    <label class="control-label">   Argument2 </label>
                    <div class="controls"><input id="arg2" name="arg2" size="30" type="text"/><br /></div>
                </div>
                <div class="control-group">
                    <div class="controls"><button id="exec" class="btn btn-primary"> Search </button></div>
                </div>

    </fieldset>
</form>
<div class="res"></div>
{% endblock %}

results.html:

{% if selected %}

<div class="accordion" id="accordion2">
        {% for rel in selected %}
            <div class="accordion-group">
              <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" data-target=".res#collapse{{ rel.id }}">
                  {{ rel.arg1 }} / {{ rel.rel }} / {{ rel.arg2 }}
                </a>
              </div>
              <div id="collapse{{ rel.id }}" class="accordion-body collapse">
                <div class="accordion-inner">
                  {{ rel.sentence }}
                </div>
              </div>
            </div>
        {% endfor %}
        {% else %}
                    <p>No matching relations are are available.</p>
</div>
{% endif %}

When I copy the generated html to another file collapsable works, but it doesn’t work when it is used with .html(). All the necessary files are linked.

  • 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-03T12:24:55+00:00Added an answer on June 3, 2026 at 12:24 pm

    You need to enable it manually via javascript:

    $(document).ready(function() {
        $("#exec").click(function() {
                var dataString = 'arg1='+ $("input#arg1").val() + '&rel=' + $("input#rel").val() + '&arg2=' + $("input#arg2").val();  
                //alert (dataString);return false;  
                $.ajax({  
                    type: "GET",  
                    url: "/query",  
                    data: dataString,  
                    success: function(data) {  
                        $(".res").html(data).collapse(); // add collapse!
                    }  
                });  
                return false; 
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit : SOLVED Right. I found the thing that confused me. I use pgadmin
Edit: Solved, I wasn't using 'validate()' after adding components. I have a GUI class
EDIT: Solved. I was unware that enabling a language extension in the source file
EDIT: Solved, my mistake; explained in my answer. I have this: std::vector < boost::shared_ptr
EDIT: solved. ans var needed to be set to 0 in every iteration.That was
EDIT: SOLVED! I have been working on my own framework lately. I have a
EDIT: SOLVED. Correct code below the problem code. I'm having trouble getting my code
Edit Solved and Reposted as sample program The scenario was as follows: The class
Edit: Solved. Hi, I'm starting with Qt, I try to connect a slot to
edit: Solved - mod_rewrite was the problem I can't get CI to work as

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.