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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:30:37+00:00 2026-05-31T11:30:37+00:00

I tried a jquery function using jQuery and it’s not working It’s pretty weird.

  • 0

I tried a jquery function using jQuery and it’s not working

It’s pretty weird. I put some alerts in the js file, but when I click on the button (with id=”gettotalnutrients”), none of the alerts from the js file happen.

this is where I grab the data for the js file (and display the data):

        <div id="feedback"></div>
    <br />
    <form id="form_date_nutrient_getter" action="account-overview.php" method="POST">
    Select a start date: <input id="datestart" type="text" name="beginday_calendar"><br />
    Select a end date: <input id="dateend" type="text" name="endday_calendar"><br />
                    <input type="button" id="gettotalnutrients" value="Get the total nutrients" ><br /><br /><br /><br /><br /><br /><br />
    </form>
    </div>

js file:

$('#gettotalnutrients').click(function(){
           alert('test');
           var datestart = $('#datestart').val();
           alert(datestart);
           var dateend = $('#dateend').val();
           alert(dateend);
           $.post('getTotalNutrients.php',(beginday_calendar: datestart, endday_calendar: dateend), function(data){
            $('#feedback').text(data);
                });
                                });
  • 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-31T11:30:40+00:00Added an answer on May 31, 2026 at 11:30 am

    wrap your click() function in $(document).ready() or something like that:

    $(document).ready(function() {
      $('#gettotalnutrients').click(function(){
        // the rest of your code goes here
      });
    });
    

    Also, are you seeing any errors in the js console?

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

Sidebar

Related Questions

I have tried to find some decent documentation on traversing in jQuery, but have
I have tried this, (note that I am using jQuery): function HandleFileButtonClick() { 1.
I'm trying to do my own drag and drop function using jquery library. But
I tried using jQuery, and it adds the title as I instruct, but it
can any one please tell me why this jQuery function is not working. It
I tried to do this: try{ (function($){ ... my plugin stuff })(jQuery); }catch(er){ alert(an
I want to upload picture from my_form in jQuery, I tried submit() function it
I tried the jQuery fadeIn animation in all browsers and it work good, but
I tried to run 2 JQuery-ajax at the same time, but it's seem always
I tried to show an error message using the jquery effect fadeTo and tried

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.