Skip to main content
Known Participant
Jan 31, 2013 9:26 PM UTC
Answered

jquery date picker

<link rel="stylesheet" href="css/jquery-ui.css" />
<script src="scripts/jquery-1.8.3.js"></script>
<script src="scripts/jquery-ui.js"></script>

<script>
    $(function() {

       $("#datepicker").datepicker({ minDate: 0 });

    });


</script>

this loop returned records from table.  Supposed it returned 5 records.  The code below only show the calendar for first text box.  how can I display every calendar all of tex boxese
<cfloop query="q_sale_order">
<cfinput type="text" value="#dateformat(sale_date, 'mm-dd-yy')#"  id="datepicker" name="sale_date#id#"  />
</cfloop>

Thanks

This topic is closed to new replies. Start a new post to keep the conversation going.
Dan_BracukCorrect answer
Inspiring
Feb 1, 2013 1:29 PM UTC

Put the calendar inside your loop.  Also, append the id value from your query to the id attribute of your cfinput tag.

5 replies

Dan_BracukCorrect answer
Inspiring
Feb 1, 2013 1:29 PM UTC

Put the calendar inside your loop.  Also, append the id value from your query to the id attribute of your cfinput tag.

Translate
newcfAuthor
Known Participant
Feb 1, 2013 3:03 PM UTC

worked, thanks alot.

Translate
newcfAuthor
Known Participant
Mar 22, 2013 12:41 AM UTC

Hi,

Like i said from very first posted, it is dynamic display from the table.  The pop up calendar appears on the right side of text box if i have about 10 or 15 records(rows) on the page .  But if more records such as 50 or 100 records (rows) then when i scroll dow or half way down and click on text box, no pop up calendar appeas on the right side of text box.

How can i make this pop up calendar dispay beside the text box regarless for how many records i have on the page?

here what i have now. 

<script>

     $(function() {   

     $( "##datepicker_#id#" ).datepicker({   

    minDate:0,

    minYear:0,

      changeMonth: true,     

      changeYear: true ,

  

    beforeShow: function(input, inst)

    {

        inst.dpDiv.css({marginTop: -input.offsetHeight + 'px', marginLeft: input.offsetWidth + 'px'});

    }

  

      });

     });

     </script>

thanks

Translate