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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:12:03+00:00 2026-05-30T19:12:03+00:00

I am trying to call a jQuery action within a div (subpage) that was

  • 0

I am trying to call a jQuery action within a div (subpage) that was generated by JavaScript. I pretty new at this so bear with me.

In the index.html I am populating a div, via a JavaScript load command.

    <ul>
            <li><a href="./data/new_group_form.php" onclick="load('./data/new_group_form.php','content');return false;">Add new Group</a></li>
            <li><a href="./data/list_group.php" onclick="load('./data/list_group.php','content');return false;">List Groups</a></li>
    </ul>

    <div id="content"></div>

Then on the page that is generated (which isn’t a full HTML page, just a form).

<?php
    include "../incl/db_class_inc.php";
?>

<script>
    $('input').live('click', function(){
        $("input:.datepicker").datepicker();
    });
</script>

<form action="./data/save_group.php" method="post" enctype="application/x-www-form-urlencoded">
<hr>
<table>
    <tr>
        <td>Group number:</td>
        <td><input type="number" name="name" required /></td>
    </tr>
    <tr>
        <td>Start date:</td>
        <td><input type="date" name="start_date" class="datepicker" required /></td>
    </tr>
    <tr>
        <td>End date:</td>
        <td><input type="date" name="end_date" class="datepicker" /></td>
    </tr>

I am trying to run a jQuery script, and it will not run for anything. I know it has something to do with the .live() function right?

How do I get this jQuery function to run in the new DIV that is created?

  • 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-30T19:12:04+00:00Added an answer on May 30, 2026 at 7:12 pm

    Your selector is wrong:

    $("input:.datepicker").datepicker();
    

    You need to delete the :

    $("input.datepicker").datepicker();
    

    Note that live is deprecated, if you’re using jQuery version 1.7+ use the on function instead

    $('body').on('click', 'input',function(){
        $("input.datepicker").datepicker();
    });
    

    Replace body with the closest static element that holds the dynamic inputs (div\form)

    Move the inline scripts to the js file (separate of concerns). The HTML should only take care of the presentation of the page, not on the scripts at all.

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

Sidebar

Related Questions

I'm trying to call a function that contains jQuery code. I want this function
I'm submitting a form using a call to this JavaScript function: function emailFriend(){ jQuery(form[name='comparisons']).attr(action,
Im trying to build call to action button on my site using jQuery. I
When I'm trying to call an ascx with Jquery post I get: This type
I'm trying to call a server-side action in a controller from jQuery: $.ajax({ url:'http://localhost:88/admin/business/11/GetChildBusinessTypes',
I am trying to call a controller action from a jquery UI dialog. What
I'm trying to call the 'tariff' action of my 'countries' controller using jQuery ajax()
I'm trying to call an action method in an MVC application using jQuery. Basically
I am trying to call a PageMethod using jQuery like this: [WebMethod] public stataic
I am trying to achieve a JQuery AJAX call to a controller action method

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.