1

I am desperately trying to display a date_popup field in my form with a text eg("please select date") as default value and not a date. Can someone help? Thanks a lot. my form now with date_popup

my code for the date_popup

1 Answer 1

0

Try using the placeholder html5 attribute by removing the #default_value from the array.

So, take out....

'#default_value' => $date,

and replace with

'#attributes' => array('placeholder' => t('Please select date')),

or, as you already have attribute, add it to that

3
  • Hi, thank you very much indeed for taking the time to reply. I have tried both solution but none seems to work unfortunately... any other idea? Thank you very much again
    – AymericLI
    Mar 10, 2015 at 22:21
  • 1
    Sorry finally it works ! Brilliant thank you so much for your help, much appreciated.
    – AymericLI
    Mar 10, 2015 at 22:35
  • That's great! Please mark my answer as correct if it helped!
    – Collins
    Mar 11, 2015 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.