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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:29:05+00:00 2026-06-09T15:29:05+00:00

I am dynamically loading question content into a div using jquery . This is

  • 0

I am dynamically loading question content into a div using jquery . This is my first attempt and it does load when I click the “Get Question”-button. However, the “Get Question”-button disappears when the question loads. I want the button to stay and eventually use it as a next question button.

Here is the jquery code:

<script type="text/javascript" src="../jquery/jquery/jquery-1.7.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(
$("#GetQuest").click(function(){
    $.post("CCRN/question.php", {num : parseInt($("input#q_num").val()) + 1}, function (data) {
        $("div#question").html(data);
        $("input#q_num").val() =  parseInt($("input#q_num").val()) + 1;
    });
});
});
</script>

<input type="button" id="GetQuest" value="Get Question" />
<input type="hidden" id="q_num" value=1 />
<p>Question: <div id="question"> </div></p>
<p>Answer: <div id="answer"> </div></p>

Here is the question creating code (though the question loads and display fine)

<table width="100%"><?php
$i = $q_num;
if ($row["image"] <> NULL) { ?>
 <tr align="center">
    <td colspan="2" align="center">
        <img src="<?php $pic = $row["image"]; echo $base_path . $pic; ?>" />
    </td>
 </tr><br />
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<?php
 } ?>
<tr id="Qu<?php echo $i; ?>" class="Qu<?php echo $i; ?>">
<td width="7%"><?php echo $i.") " ?></td>
<td width="93%" ><?php echo $row["question"]; ?></td>
</tr>

<?php 
for ($j=1;$j<=6;$j++) { 
$bracket= "answer_" . $j;
if ($row[$bracket] !== NULL) {?>
    <tr>
        <td align="center" class="row<?php echo $j % 2; ?>" width="7%">
            <input type="radio" <?php echo ($_POST["Q".$i] == $j) ? 'checked="checked"' : '' ; ?> name="Q<?php echo $i; ?>" value="<?php echo $j; ?>" /><?php echo chr(64 + $j); ?>
        </td>
        <td class="row<?php echo $j % 2; ?>" width="93%">
            <?php echo $row["answer_".$j]; ?>
        </td>
    </tr> <?php
}
} ?>
</table><hr size="2" width="95%">

I do not understand why the button disappears when I load the question content. I am SURE it is something embarassing simple, which is why I am coming to a safe haven to minimize the ridicule! 🙂

Live test site http://www.GrowingSpeakers.com/index2.php to see the disappearing button.

  • 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-09T15:29:07+00:00Added an answer on June 9, 2026 at 3:29 pm

    You are using div with id “question” before.

    <div class="TabbedPanelsContent" id="question"> 
    

    and

    <p>Question: <div id="question"> </div></p>
    

    It does not matter even though the id’s come from different files as long as they are displayed in the same DOM tree – they will be treated as one and the same.

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

Sidebar

Related Questions

I'm dynamically loading different content from db, using ajax. So, when I'm loading plain
I'm loading (large) images dynamically to draw into a html5 canvas, something like this:
I'm dynamically loading movie clips (SWFS) into attached clips (from the library). The loaded
I am using JSF and have made a custom servlet for loading images dynamically.
I am using AJAX requests (more specifically, jQuery's load method) to load different views
I am trying to dynamically load a progressive jpeg using ActionScript 3. To do
My data from getmovies.php is working correctly and loading into #moviesPage the FIRST time
I am dynamically appending HTML to a webpage and I'm also using jQuery to
This is my first question, hence please ignore mistakes, if any. I have an
I'm using mootools 1.2 in a page where I'm loading a js graph into

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.