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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:18:41+00:00 2026-05-20T05:18:41+00:00

Could you please take a look and tell why this isnt working i cant

  • 0

Could you please take a look and tell why this isnt working i cant figure it out. the problem is with

$("#item_name").val(item_name);
$("#amount").val(course_price);

This should be adding info to 2 hidden inputs (

<input type="hidden" name="item_name" id="item_name"value="">
 <input type="hidden" name="amount" id="amount" value="">

)
but they are coming up as blank

also the value from course_name.php?courseID=1 is Course Name,500

Full Javascript

<script>

      $(document).ready(function() {
url = "date_range.php?courseID="+$('#course_name').val();
  $("#dates").load(url)
  url = "course_name.php?courseID="+$('#course_name').val();
   var course_details;
$.get(url, function(data){
    course_details= data;
});
   split_course_details = course_details.split(',');
   course_name=split_course_details[0];
   course_price=split_course_details[1];
   course_date=$("#date_range").val();
   item_name=course_name+' - '+course_date;
   $("#item_name").val(item_name);
    $("#amount").val(course_price);


      });


$('#course_name').change(function() {
    url = "date_range.php?courseID="+$('#course_name').val();
  $("#dates").load(url)
  url = "course_name.php?courseID="+$('#course_name').val();
  var course_details;
$.get(url, function(data){
    course_details= data;
});
   split_course_details = course_details.split(',');
   course_name=split_course_details[0];
   course_price=split_course_details[1];
   course_date=$("#date_range").val();
   item_name=course_name+' - '+course_date;
   $("#item_name").val(item_name);
    $("#amount").val(course_price);
});

</script>
  • 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-20T05:18:41+00:00Added an answer on May 20, 2026 at 5:18 am

    Place your calculation inside the callback function of $.get(), like this:-

    $(document).ready(function() {
        url = "date_range.php?courseID=" + $('#course_name').val();
        $("#dates").load(url)
        url = "course_name.php?courseID=" + $('#course_name').val();
        var course_details;
        $.get(url, function(data) {
            course_details = data;
            split_course_details = course_details.split(',');
            course_name = split_course_details[0];
            course_price = split_course_details[1];
            course_date = $("#date_range").val();
            item_name = course_name + ' - ' + course_date;
            $("#item_name").val(item_name);
            $("#amount").val(course_price);
        });
    
    });
    
    $('#course_name').change(function() {
        url = "date_range.php?courseID=" + $('#course_name').val();
        $("#dates").load(url)
        url = "course_name.php?courseID=" + $('#course_name').val();
        var course_details;
        $.get(url, function(data) {
            course_details = data;
            split_course_details = course_details.split(',');
            course_name = split_course_details[0];
            course_price = split_course_details[1];
            course_date = $("#date_range").val();
            item_name = course_name + ' - ' + course_date;
            $("#item_name").val(item_name);
            $("#amount").val(course_price);
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

could somebody please take a look at this http://jsfiddle.net/bloodygeese/EzkFR/1/ My aim is to on
Could someone please take a look at this sloppy code and explain to me
Please take a look at the screenshot on the left: http://bit.ly/a4F5Ln Could anyone tell
Could someone please take a look at this ? You'll see the first alert
Could someone please take a few moments out of their schedule to look at
Could you please take a look at the harvard medical school website here http://hms.harvard.edu/
Could someone please tell me why this <%= destroy_password_url @user.password_reset_token %> generates http://localhost:3000/api/destroy_password.4G5EoRVYMUAtiIKqOerKsw routes.rb
Could you please check out this piece of code: #include <vector> class A {
Well Im stucked at this point.please take a look at this http://jsfiddle.net/karthik64/5jhgF/3/ Okay first
Please take a look at this macro. It is used in Symbian OS SDK,

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.