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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:07:07+00:00 2026-06-12T14:07:07+00:00

I do an ajax call to post and then retrieve from the controller all

  • 0

I do an ajax call to post and then retrieve from the controller all the days between two given dates.
Here is my JS function :

function  getDays()
    {

          var  date1= $('#start_date').val();
          var  date2=$('#end_date').val();
          $.ajax({
            type:'POST',
            url : '<?php echo site_url()."/public/hours/getHoursDetails/"; ?>',
            data : 'start_date='+date1+'&end_date='+date2,

            success:function(data)
                 {  $('#result').html(data);
                    $('#hoursDetails').show();
                           }

                    }); 
     } 

I got on my view the list of all the days I need. But what I would like rather to do is to display after each date some inputs , like

<label><strong>Action(s)</strong></label>   
<textarea class="span8" style="height:100px" placeholder="Description de votre action"
id="action" name="action"></textarea> 
<label><strong>Number of hours :</strong></label><input type="text" class="span4" id="hours" name="hours" placeholder="number of hours"/>

My problem is that I can’t display row by row each date.
Here is an example of what I got on my view :

"Tuesday, October 09 2012."
"Wednesday, October 10 2012."
"Thursday, October 11 2012."
"Friday, October 12 2012."

Could anyone help me please?

  • 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-06-12T14:07:09+00:00Added an answer on June 12, 2026 at 2:07 pm

    Can’t you just take each date from the results, append the extra HTML and then add it all together before inserting into the #result element?

    put the extra HTML in a variable:

    var inputHTML = '<label><strong>Action(s)</strong></label><textarea class="span8" style="height:100px" placeholder="Description de votre action" id="action" name="action"></textarea><label><strong>Number of hours :</strong></label><input type="text" class="span4" id="hours" name="hours" placeholder="number of hours"/>';
    var date1= etc...
    

    then inside the success function:

    var resultHTML = ""
    var datesArray = data.split('.');
    for (i=0;i<datesArray.length-1;i++) {
        resultHTML += datesArray[i] + inputHTML;
    }
    $('#result').html(resultHTML);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my ajax call: $.ajax({ url: 'url-to-json', type: 'POST', dataType: 'json', cache: 'false', data:
I have two ajax calls to a web service from jquery. The first call
I'm using $.post() to call a servlet using Ajax and then using the resulting
I am trying to use relative url with a post ajax call as follows:
AJAX Call $.ajax({ url: '/api/Inventory', cache: false, type: 'POST', data: json, contentType: 'application/json, charset=utf-8',
I'm using jQuery to make an Ajax call using an Http Post in ASP.NET
I'm using $.ajax() to send a post call to the server. If I use
I have a setup where I get some information, in an ajax call, then
A function triggers a database call which returns some Json. This CID is then
am making an ajax call to retrive json data i then store the retrived

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.