Question

Issue with Date field placeholder text visibility in mobile browser

  • 14 June 2021
  • 5 replies
  • 137 views

I was developing a form for a Google Adword landing page. But the placeholder text in the date field is was not showing up. Therefore I used a hack suggest in Elementor help. The code is 

input[type='time']:after {
    color: #7a7a7a;
    content: attr(placeholder);
}
input[type='date']:after {
    color: #7a7a7a;
    content: attr(placeholder);
}
 

This solved my problem of placeholder text but Google Ads considered it as a Malicious code. Can we solve this? 


5 replies

Userlevel 6
Badge +4

Hello @Aswani Singh have you find your answer yet? If so, please share it here so we can mark your answer as the best one and help others who may run into a similar issue.

Userlevel 7
Badge +4

If you’re not using the Elementor form widget then try something like this for your field:

<input placeholder="Date" class="date-input" type="text" onfocus="(this.type='date')" onblur="(this.type='text')" id="date" />

@Abner Rojas I am using Elementor form widget

Userlevel 6
Badge +4

Hello @Aswani Singh have you find your answer yet? If so, please share it here so we can mark your answer as the best one and help others who may run into a similar issue.

Badge +1

I’m having the same issue - the Elementor Form widget Date placeholder is not showing up on mobile.

Reply