Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2011
    Posts
    148
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Popupcalendar with dynamically created text box

    Hi Experts,

    i'am able create dynamically 2 text boxes ( start date & End Date) . Also i am able to create dynamically (img) calendar gif pictures beside each textbox.
    What i am stuck on is how to popup a calendar while clicking on the img and assign the date to a dynamic texboxes...

    Any help is much appreciated..

    thank you


    here is the part of my code :

    // Create Start Date Text box
    var newStartDate = document.createElement('input');
    newStartDate.setAttribute("type","date");
    newStartDate.size=8;


    // Create calendar 1 img
    var newCalImg1 = document.createElement('img');
    newCalImg1.src = "../media/forms/cal.gif";



    // Create End Date Text box
    var newEndDate = document.createElement('input');
    newEndDate.size=8;

    // Create calendar2 img
    var newCalImg2 = document.createElement('img');
    newCalImg2.src = "../media/forms/cal.gif";
    Last edited by korssane; 07-28-2011 at 08:50 PM.

  • #2
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,746
    Thanks
    18
    Thanked 155 Times in 146 Posts
    Pick a script -- there are many to choose from: http://lmgtfy.com/?q=javascript+calendar+date+picker
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!

  • #3
    Regular Coder
    Join Date
    Jun 2011
    Posts
    148
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Hi R.J,
    thanks for the quick reply .
    but i have my calendar.js that i can call ..,the problem is how can i get the value of the calendar assigned to dynamically created textbox..

    In the same timie..do you know how can i capture the value of a dynamically created textbox in Javascript ?

    thanks a lot

  • #4
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,746
    Thanks
    18
    Thanked 155 Times in 146 Posts
    Quote Originally Posted by korssane View Post
    Hi R.J,
    thanks for the quick reply .
    but i have my calendar.js that i can call ..,the problem is how can i get the value of the calendar assigned to dynamically created textbox..

    In the same timie..do you know how can i capture the value of a dynamically created textbox in Javascript ?

    thanks a lot
    you get the value of a textbox like so:

    Code:
    <form name="myform">
       <input type="text" id="mytextbox" name="mytextbox" />
    </form>
    
    <script type="text/javascript">
       var tboxValue = document.myform.mytextbox.value;  // OR
       var tboxValue = document.getElementById('mytextbox').value;
    </script>
    To help you with your specific problem, we would need to see all calendar.js code as well as the HTML file that includes calendar.js.
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •