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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:37:17+00:00 2026-06-12T20:37:17+00:00

My problem is quite simple but I can’t resolve it.I’m trying to populate a

  • 0

My problem is quite simple but I can’t resolve it.I’m trying to populate a form via a js function . Here is my form (for each date, the user can enter what he did on that day (action) and the time spent on this action(NbHour)):

<div id="hoursDetails" class="toogle_form" style="display:none">
      <table border=0>
          <?php for ($i=0 ; $i<3; $i++){
        echo '<tr>
                  <td><div id="date'.$i.'" ></td>   
               <td><input type=text name="action'.$i.'"  placeholder="Votre action">
               <input type="text" name="Nbhour'.$i.'"  placeholder="nombre heures">
               </td>
            </tr>
       </table> ' ;}
        ?>

The problem occurs when I try to populate this form . Here is how I do in the js function :

$('#date0').html('monday');
$('#date1').html('tuesday');
$('#date2').html('wednesday');

Strangely, this shows only monday with the two inputs : action and number of hours.
For the second row, it prints only tuesday. And the third row doesn’t exist.
What I am doing wrong ? Thank you for your help

  • 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-12T20:37:18+00:00Added an answer on June 12, 2026 at 8:37 pm

    Your markup is invalid, looping with closing the table (</table>) in each iteration will break the markup.

    move </table> out of the loop and close the hoursDetails <div>

    <div id="hoursDetails" class="toogle_form" style="display:none">
    <table border=0>
    <?php for ($i=0 ; $i<3; $i++){
        echo '<tr>
            <td><div id="date'.$i.'" ></div></td>   
            <td>
                <input type=text name="action'.$i.'"  placeholder="Votre action">
                <input type="text" name="Nbhour'.$i.'"  placeholder="nombre heures">
            </td>
        </tr>' ;}
    ?>
    </table>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a quite simple problem but i can't seem to resolve it. Let's
The problem here is pretty simple but I just can't quite figure it out.
I have a seemingly simple problem, but I can't quite figure out a solution.
I've got a quite strange problem here. I'm calling some simple code via Ajax.Updater:
The solution to my problem is probably quite simple, but I can't find it.
I have quite a simple problem but can't find a solution for it. I
What I'm trying to do is quite simple in sql but I can't get
I have a problem that is quite simple to understand, but for me it
My problem seems to be quite simple, but it's not working the intuitive way.
This is probably quite simple but I've googled and can't find an answer. 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.