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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:44:56+00:00 2026-05-29T10:44:56+00:00

I am having hardtime figuring out what’s wrong with load() function in the below

  • 0

I am having hardtime figuring out what’s wrong with load() function in the below code.
What this code basically does is take a date(named as tabledate in the form) from user through a form( whose id is caltag) and gives a table with all events of that day. But whatever date I give through the form, I always get todays schedule. I am not sure even if jquery part is being executed fully because
submit button is even being disabled as the code says. Moreover, I dont know how to debug js programs.
Have been stuck for hours on this. Any suggestions would be of great help.

$("#caltag").submit(
                function(e){
                    $("#caltag").attr('action', '/table/fetch/');
                    e.preventDefault();
                    $("submit").attr('disabled',true);
                    var calform=$("#caltag");
                    var values = $("#caltag").serializeArray();
                    $("#table").load(
                        $("#caltag").attr('action') + "#table", 
                        values, 
                        function() {
                            $("#table").hide().fadeIn(1000);
                            $("#getdate").attr('disabled', false);
                        });});

view part of the

def table(request):  #     '/table/fetch/' requests of this view
events=[['_'] * 5 for row in range(5)]
if request.method=='POST':
    datestring=request.POST['tabledate']
    date=datetime.strptime(datestring,'%m/%d/%Y').strftime('%Y-%m-%d')
else:
    date=datetime.today()
eventset=Location.objects.filter(eventdate=date)
for event in eventset:
    events[event.x][event.y]=event
return render(request, 'scheduler/table.html',{'events':events,'tabdate':date})

html form for the same.

<div id="cal" class="span-10">
                <form method='POST' id='caltag' action="/table/fetch/">
                    <p>
                        <label for="datepicker">tabledate:</label>
                        <input type="text" id="datepicker" name="tabledate" />
                    </p>
                    <input type='submit' id="getdate">
                </form>
            </div>
  • 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-29T10:44:56+00:00Added an answer on May 29, 2026 at 10:44 am

    Why do you append the string “#table” to the url?

    $("#caltag").attr('action'), 
    

    Does var values = $("#caltag").serializeArray(); show valid data? try a console.log(values); on the line below to make sure valid data is generated

    Make sure to check the the actual request that is made to make sure the right parameters are sent and the right content is received.

    Why don’t you just send the value of #datepicker? var values = { 'date': $("#datepicker").val() };

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

Sidebar

Related Questions

I'm having some hard time figuring out what's wrong in this simple code: This
Having a hard time figuring out the best way to do this... I have
I'm having a hard time figuring this one out. Seems like no matter what
I am having a hard time figuring out what is wrong. As soon as
I am having a hard time figuring out how to return the current date
I'm having a hardtime figuring out on how can I generate a twice repeating
I'm having a hard time figuring out why lseek doesn't work properly. Basically all
Having a hard time figuring out the best way to go about this. What
I am having a hard time figuring out how to code a series of
I'm having a hard time figuring out how to do this if statement. I

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.