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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:39:36+00:00 2026-06-16T11:39:36+00:00

how to add Jquery datepicker in dynamically loaded textbox.i.e., When i click a button

  • 0

how to add Jquery datepicker in dynamically loaded textbox.i.e., When i click a button , the popup containing textboxes from external page will shows in the present page. in that textbox i want to use datepicker.

i have used following ajax for Loading a external page

    <script type="text/javascript">
function manageapp(id,apcno)
    {
        /*alert(id);
        alert(apcno);*/
        //alert(dd);
        if (window.XMLHttpRequest)
        {// code for IE7+, Firefox, Chrome, Opera, Safari
            req=new XMLHttpRequest();
        }
        else
        {// code for IE6, IE5
            req=new ActiveXObject("Microsoft.XMLHTTP");
        }
        var strURL="manage_ajx.php?id="+id+"&acpno="+apcno;
        if (req) 
        {
            req.onreadystatechange = function() {
            if (req.readyState == 4) {
             // only if "OK"
                if (req.status == 200) 
                {
                    document.getElementById('show_details').innerHTML=req.responseText;
                } else {
                    alert("There was a problem while using XMLHTTP:\n" + req.statusText);
                    }
                }               
            }           
            req.open("GET", strURL, true);
            req.send(null);
        }   
    }


 </script>

Following for Popup

 <script type="text/javascript">
//New Pop up
$(document).ready(function() {
    $('#inline').hide();
    $('.login-window').click(function() {

            $('#inline').addClass("login-popup");
            $('#inline').css({'visibility':'visible'});

        // Getting the variable's value from a link 
        var loginBox = $(this).attr('href');

        //Fade in the Popup and add close button
        $('#inline').fadeIn(300);

        //Set the center alignment padding + border
        var popMargTop = ($(loginBox).height() + 24) / 2; 
        var popMargLeft = ($(loginBox).width() + 24) / 2; 

        $('#loginBox').css({ 
            'margin-top' : -popMargTop,
            'margin-left' : -popMargLeft
        });

        // Add the mask to body
        $('body').append('<div id="mask"></div>');
        $('#mask').fadeIn(300);

        return false;
    });

    // When clicking on the button close or the mask layer the popup closed
    $('a.close, #mask').live('click', function() { 
      $('#mask , .login-popup').fadeOut(300 , function() {
        $('#mask').remove();  
    }); 
    return false;
    });
});
</script>

following is for call thae popup page
//php coding

<a class="login-window" href="#inline"  title="Business Details" onclick="javascript:manageapp('<?php echo $patientlist[$i]['ap_id']; ?>','<?php echo $patientlist[$i]['apc'];?>')">

<img src="images/calendar-icon.png" title="manage appointment"/>

</a> 

?>
//php coding

any body can help me to fix this problem

  • 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-16T11:39:37+00:00Added an answer on June 16, 2026 at 11:39 am

    I find the solutions , do it as follows, Add the datepicker function in Ajax return function ie in success

    <script type="text/javascript">
        function manageapp(id,apcno)
        {
            /*alert(id);
            alert(apcno);*/
            //alert(dd);
            if (window.XMLHttpRequest)
            {// code for IE7+, Firefox, Chrome, Opera, Safari
                req=new XMLHttpRequest();
            }
            else
            {// code for IE6, IE5
                req=new ActiveXObject("Microsoft.XMLHTTP");
            }
            var strURL="manage_ajx.php?id="+id+"&acpno="+apcno;
            if (req) 
            {
                req.onreadystatechange = function() {
                if (req.readyState == 4) {
                 // only if "OK"
                    if (req.status == 200) 
                    { 
    
    
                        document.getElementById('show_details').innerHTML=req.responseText;
    
    
                            $("#frompop").datepicker({
                                defaultDate: "+1w",
                                changeMonth: true,
                                changeYear: true,
                                numberOfMonths: 1,
    
                            });
                            $('#timepickerpop').timepicker({ 'timeFormat': 'g:i A','step':15,'minTime': '8:00am','maxTime': '8:00pm'  });
    
    
    
                    } else {
                        alert("There was a problem while using XMLHTTP:\n" + req.statusText);
                        }
                    }               
                }           
                req.open("GET", strURL, true);
                req.send(null);
            }   
        }
        </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add a custom button to the button panel of jQuery's datepicker.
I'm using jQuery to dynamically add rows to my HTML table on a button
I create a textbox and add a Jquery UI datepicker.But when I select and
I'm using jQuery 1.4.4 and I'm stuck trying to add a datepicker dynamically by
i am trying to get date from my implementation of jquery date picker, add
I am having a problem with the jQuery datepicker. My form has a add
I have this program and i want to add a jquery datepicker on it,
I have a issue with a Jquery DatePicker popup dialog being clipped by an
I started integrating jquery ui datepicker in my page. I included the js files:
I have a jQuery UI Datepicker object popping up when I click inside a

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.