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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:48:33+00:00 2026-05-31T07:48:33+00:00

I have a webpage made of a lot of PHP and Jquery/javascript I have

  • 0

I have a webpage made of a lot of PHP and Jquery/javascript

I have a function that runs when a submit button is clicked

$("#yesterday").click(function(){
            var $date = $.datepicker.parseDate('yymmdd','<?php echo $_POST['date']; ?>');
            var julDate = $.datepicker.formatDate('yyoo',new Date($date));
            Number(julDate);
            julDate = julDate - 1;
            String(julDate);
            var $date = $.datepicker.parseDate('yyoo',julDate);
            var julDate = $.datepicker.formatDate('yymmdd',new Date($date));
            var $longDate = $.datepicker.formatDate('DD MM d, yy',new Date($date));
            $("#date").val(julDate);
            $("#longdate").val($longDate);
            $("#orwell_btn").click();
return false;
});

This function works PERFECTLY it reduces the date by 1 and reloads the page and executes my SQL query returnning all the correct info

if I change the fifth line and make the function liek so:

    $("#tomorrow").click(function(){
            var $date = $.datepicker.parseDate('yymmdd','<?php echo $_POST['date']; ?>');
            var julDate = $.datepicker.formatDate('yyoo',new Date($date));
            Number(julDate);
            julDate = julDate + 1;
            String(julDate);
            var $date = $.datepicker.parseDate('yyoo',julDate);
            var julDate = $.datepicker.formatDate('yymmdd',new Date($date));
            var $longDate = $.datepicker.formatDate('DD MM d, yy',new Date($date));
            $("#date").val(julDate);
            $("#longdate").val($longDate);
            $("#orwell_btn").click();
return false;
});

the function doesn’t complete and my page loads but as if it would on the very first load (which I have logic to handle but it should be advancing by 1 day ie doing the opposite of the yesterday button)

seems very odd to me

  • 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-31T07:48:35+00:00Added an answer on May 31, 2026 at 7:48 am

    Number(julDate) returns a number with the parsed value.
    It doesn’t actually change anything.

    Therefore, julDate + 1 is string concatenation.

    You want julDate = Number(julDate).

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

Sidebar

Related Questions

I have a WebPage made that is 90% Javascript. All of the WebSite is
I have a webpage that retrieves data (via ajax/php) and shows it in an
I have a webpage that redirects to another webpage like this: http://www.myOtherServer.com/Sponsor.php?RedirectPage=http://mylink.com/whereIwasgoingtogo.html Then the
I have a webpage that's divided into two columns. I have made these columns
I have made the following webpage for generating interactive todo lists: http://robert-kent.com/todo/todo.php Basically, the
I have made webpage that uses Ajax to update some values without reloading the
I made a webpage that needs javascript. More specifically if anyone has heard of
I have made this webpage, you can check it out here http://www.bettingtowin.net/webcam.html I have
I have taken script from a webpage document I have made and I have
I have a webpage that is transferring A stylesheet as a text/plain MIME type.

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.