How to set disabled if control has a value

How to set disabled if control has a value

I want to set all date fields to disabled if they have a value.
All fields share a common class - 'datefield'.

I am a newbie and appreciate any help.

Thanks,

Bill