Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

I'm not positioning these elements in my code correctly. What do I need to change?

This works:

<script>
        $(function() {
            $("#datepicker").datepicker({'onSelect':function(dateText){
                      if( dateText.match(/\d\d\/\d\d\/\d\d\d\d/) )
                      {
                           $(this).css({"color":"#000000"});
                       }
                      else
                      {
                           $(this).css({"color":"#CCCCCC"});
                       }

                }});
        });
    </script>

                                          

Open in new window


This does not:

 <script>
        $(function() {
            $("#datepicker").datepicker({'onSelect':function(dateText){
                      if( dateText.match(/\d\d\d\d-\d\d\-\d\d/) )
                      {
                           $(this).css({"color":"#000000"});
                       }
                      else
                      {
                           $(this).css({"color":"#CCCCCC"});
                       }
                }		
			{dateFormat:"yyyy-mm-dd"}});
        });
    </script>

Open in new window


The code that works is exactly what I need with the exception of the date format. I'd like to include that, but every time I try, the script fails. I'm confident that there's something wrong with the placement of the additional code (dateFormat), but I don't know what.

Can you help a brother out?

Head out to http://brucegust.com/portfolio/verizon/javascript_test.php to see it action.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bruce Gust

ASKER

That will do it!

Thanks, Tom!
Anytime. Thanks for the points.