How would I get the color of this datepicker field to change onblur?

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

Click on the date field (start date). You'll get a calendar. You can select a date and the date shows up in the field.

Perfect.

I want the color of the date you just entered to be black. How?

I've learned some things via google. I've found an "onSelect" dynamic, but I've yet to be able to make it work.

Bottom line: On "blur," I want the color of the text in my date field to change from grey to black.

How?
Bruce GustPHP DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alexandre SimõesManager / Technology SpecialistCommented:
Remove the inline style that sets the grey color and add this style:
input:focus {
    color: #ccc !important;
}

Open in new window

I just don't agree doing this because the user can edit the text manually and it will be grayed out
hieloCommented:
Try:
<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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bruce GustPHP DeveloperAuthor Commented:
Perfect, hielo! That definitely does the trick. And thanks for weighing Alexandre, but the user can't manually adjust what goes into that field.

However...

Guys, I'm still not where I need to be and if you would like, I have what amounts to "part II" of this question at http://www.experts-exchange.com/questions/28699331/I%27m-not-positioning-these-elements-in-my-code-correctly-What-do-I-need-to-change.html

Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.