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

  • Home
  • SEARCH
  • 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 6018005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:12:41+00:00 2026-05-23T03:12:41+00:00

I will try and explain my problem as accurately as possible, I don’t think

  • 0

I will try and explain my problem as accurately as possible, I don’t think a JSFiddle will help in this case.

What I have is a page where all records of a database table are shown and a form to add a new record.

Once the form is filled in and submitted, the new record is added to the database correctly and the old html table is faded out to allow for the new table to be faded in but this is where it breaks and I am left with a blank section where the table should be.

Appropriate code below:

gigs.php:

$(".comment_button").click(function() {

$('#gigs').fadeOut(1000).empty();

var dateval = $("#date").val();
var venueval = $("#venue").val();
var timeval = $("#time").val();
var untilval = $("#until").val();
var mapval = $("#map").val();


var dataString = 'date='+ dateval + '&venue='+ venueval + '&time='+ timeval + 'until='+ untilval + 'map='+ mapval;

if(dateval=='')
{
    alert("Please select the date of the gig");
}
else if(venueval=='')
{
    alert("Please enter a venue");
}
else if(timeval=='')
{
    alert("Please select a start time");
}
else if(untilval=='')
{
    alert("Please enter a finish time");
}
else
{
    $("#flash").show();
    $("#flash").fadeIn(400).html('<img src="images/loading.gif" align="absmiddle">&nbsp;<span class="loading">Updating Gigs...</span>');

    $.ajax({
        type: "POST",
        url: "add-gigs.php",
        data: dataString,
        cache: false,
        success: function(html){
            $("gigs").prepend(html).fadeIn(1000);
            $("#flash").fadeOut(1000);  
        }
    });
}
return false;
});
});

The form to add the new record:

<form  method="post" name="form" action="">
                <fieldset>
                <legend>Add Gig</legend>
                <span class="add-gig-label-venue">Venue:</span>  <input type="text" name="venue" id="venue" maxlength="100" /><br />
                <span class="add-gig-label-date">Date:</span>  <input type="text" name="date" id="date" maxlength="10" />
                <span class="add-gig-label-start">Start Time:</span>  <input type="text" name="time" id="time" maxlength="5" />
                <span class="add-gig-label-end">End Time:</span>  <input type="text" name="until" id="until" maxlength="5"/> <br />
                <span class="add-gig-label-map">Google Maps URL:</span>  <input type="text" name="map" id="map" />
                <input type="submit"  value="Add Gig"  id="v" name="submit" class="comment_button"/>
                </fieldset>
            </form>

and below this is the div to show an ajax loading gif called flash and the table where the current records are shown:

<div id="flash" align="left" ></div>
<div id="gigs"> <!-- div that is emptied -->
<!-- Start the table -->
<table class="gig-table" cellspacing="0" cellpadding="0">
<!-- table data -->
</table>
</div> <!-- end 'gigs' div -->

The other file, add-gigs.php simply takes the POST variables and created a MySQL query to insert the new record and then has the same php code for the table as it is in the other file but obviously this one will now include the newly added row.

It is this table that I cannot get to fade in.

I hope that makes sense, otherwise I will try and elaborate further.

  • 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-23T03:12:42+00:00Added an answer on May 23, 2026 at 3:12 am

    You forgot the “#” in $("gigs")

        success: function(html){
            $("#gigs").prepend(html).fadeIn(1000);
            $("#flash").fadeOut(1000);  
        }
    

    As just $("gigs"), it means to look for a <gigs> element on the page. The “#” prefix means to look for an element by “id” value.

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

Sidebar

Related Questions

Ok I will try to explain this as much as possible. I have a
I will try to explain my problem. I have 4 files index.html, event.js, start.js
I have a problem and I will try to explain the issue: I have
I will try to explain my problem with as little code as possible. Basically
This might be a little hard to explain, but I will try. I want
i will try to explain the problem very clear. I user MicroSoftReportViewer where i
I will try to explain shortly what my problem is... I'm loading an XML
I will try to explain what exactly I need to do. I have 3
Ok so this is a really complicated problem, I will try my best to
This is a bit tricky to explain but I will try my best to

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.