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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:32:20+00:00 2026-05-24T17:32:20+00:00

hey guys I have two divs- with id=form1 which is inline and the other

  • 0

hey guys I have two divs- with id=”form1″ which is inline and the other with id=”form2″ which gets its content through ajax(where the div tag is mentioned on the same page).

<div id="form1">
 .
 .form content
 .
 .
</div>
<div id="form2"> //gets content dynamically

Now, I have used the following datepicker code-

    $(function() {
    $( "#datepicker,#datepicker1" ).datepicker({ dateFormat: 'yy-mm-dd' });
});

Now, I have applied the datepicker id to a field in form1 and it works perfectly.
The problem is in the second form. The second form gets generated by loop and i have used the following logic to apply the id datepicker1 to it-

<? foreach ($list as $key => $value): ?>
    <? $dt='';
    if($key=='date_of_purchase'){

        $dt="datepicker1";
    }?>
        <tr><td><?= $key ?> :</td><td><input id="<?=$dt;?>" type="text" name='<?= $key ?>' size="25" value='<?php echo $value; ?>'/></td></tr>
    <? endforeach; ?>

Now, the id datepicker1 is getting applied perfectly to the required field but the jquery datepicker popup is not coming up as expected.

Whats the solution??

  • 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-24T17:32:21+00:00Added an answer on May 24, 2026 at 5:32 pm
    $("#datepicker1").live("click",function() {
        $(this).datepicker({showOn:'focus',dateFormat: 'yy-mm-dd'}).focus();
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys i have a question which i have been looking for the answer
Hey guys, I have a program that uses ajax to send a post to
Hey guys i have two date inputs containing three dropboxes for day,month and year
Hey Guys I have four integer array lists which were created after parsing a
Hey guys, so I have two models in my project, grinders, and votes. So
Hey guys. I have a question. I have two different arrays with different structure
hey guys what I am trying to do is have two edit boxes for
Hey guys i have a big doubt which i noticed today in my developed
hey guys, i have a probably rather simpel problem: my website has two layers:
hey guys, i have a sitemap with h3's and ul's like this: <div id=ajax-base>

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.