Most of the users with more experiences probably already know this but
others can have problems when implementing datepicker to ASP.NET
controls, for example textbox (especially if they are inside other
control - web form, repeater).



This is a solution somebody posted on asp.net forums:

1.)  "Change the TextBox's CssClass property to "dateTextBox".  Then,
use exactly this JavaScript (remove the other inline script in that
area so there are no extraneous errors):"

1.) (inside web form, control, etc.)
<script type="text/javascript">
  $(document).ready(function() {
    $('.dateTextBox').datepicker();
  });
</script>

2.) if you do not have web control. You also don't need the css.

<script type="text/javascript">
                $(function ()
                    {$('#date').datepicker();}
                );
                    </script>


also you must have in masterpage the following code:
<link type="text/css" href="../CSS/jquery-
ui-1.7.2.calendar.css"rel="stylesheet" />
<script type="text/javascript" src="../JS/jquery-1.3.2.min.js" ></
script>
<script type="text/javascript" src="../JS/jquery-
ui-1.7.2.custom.min.js"></script>

<script type="text/javascript">
                        $(function(){

                                // Datepicker
                                $('#datepicker').datepicker({
                                        inline: true
                                });

                                //hover states on the static widgets
                                $('#dialog_link, ul#icons li').hover(
                                        function() { 
$(this).addClass('ui-state-hover'); },
                                        function() { 
$(this).removeClass('ui-state-hover'); }
                                );

                        });
</script>

There can be better options to do this. Also you must notice that this
don't work in IE  ("appearing" effect) as same as is working if you
have input type on page without any controls.

Any additional comments are welcome.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to