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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:32:22+00:00 2026-06-14T19:32:22+00:00

I am adding a div to a form that I am creating. I want

  • 0

I am adding a div to a form that I am creating. I want to do this with the on() function, but I cannot seem to make it work. From what I understand you have to use an event, but is there a way to make an event out of a div being added. The code that I have been trying is with a “click” event, but that isnt really what I want. The datepicker is added after the first click, but the buttonImage is not being added at all. I need it to work on the first click. Here is the code that I am using right now:

  $('#switcher-panel').on('click', 'table tr td input', function(){
    $('.datepicker').datepicker({
      buttonImage: "images/calendar.png"
    });
  });

Here is the html that I am using:

<table class="table table-hover" data-controller="rank">
  <thead>
    <tr>
      <th colspan="4" align="left"><h2> Boy Scout Rank</h2></th>
    </tr>
    <tr>
      <th>Number</th>
      <th>Requirements</th>
      <th>Completed</th>
      <th>Date</th>
    </tr>
  </thead>
  <tbody>
    <tr data-name="one_li">
      <td>1</td>
      <td>
        Req
      </td>
      <td>
        <input class="datepicker"/>
      </td>
    </tr>
  </tbody>
</table>

I dont understand how to handle this. Any help would be great.

  • 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-14T19:32:24+00:00Added an answer on June 14, 2026 at 7:32 pm
    $(function(){
    
        $('.datepicker').datepicker({
            showOn:"button", // or "both" if you want the input to trigger the datepicker too
            buttonImage: "images/calendar.png"
        });
    
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found this question on StackOverflow Adding div below images in colorbox But it
I have a Textarea which is in a form that has this value Hello<div
I have a function that displays comments in DIV box from a database. The
I'm currently adding a div to use as a slider programmatically, but when I
I want to add and remove div element using jquery and adding of div
I am reading contents from JSON file and adding to div with unique IDs.
I am adding element dynamically to DOM. $('<div class=entry></div>').text(data.status).appendTo(app.twitter_feed); I want to get element
After adding elements to page using something like this, $('#blah').append('<div id=bugsbunny></div>'); how can I
I am adding the form my current list in a div box at the
I'm trying to add the functionality to this dynamic order form that will auto

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.