0

I'm still using the old asp.NET 4.8, and testing asp:TextBox with Date TextMode, e.g.

 <label>ASP TextBox</label><br />
 <asp:TextBox ID="dateTB0" runat="server" TextMode="Date" ></asp:TextBox><br />

When there is no value, it displays the mask like this: enter image description here

Is it possible to hide the mask when there is no value?

UPDATE: With Chrome developers tool, it treats asp:TextBox as input[type="date"] but any approaches playing with the CSS are completely ignored. Note that when I tested <input type='date'/>, those CSS approaches worked. So, this question is specific to asp:TextBox.

Petronius
  • 428
  • 4
  • 12
  • This is the browser's standard behavior for an ``. Taking a step back... Why do you need to override this behavior? Do you want this to be a normal text input instead? Something else? – David May 18 '23 at 13:07
  • No, it is just ugly. We used a custom control which didn't display the mask. So, if I replace that control by asp:TextBox, the existing users will complain. – Petronius May 18 '23 at 13:22
  • In that case the linked duplicates are a good place to start for customizing the input. There are a handful of approaches taken, some of which are a bit browser-dependent since this is browser behavior. – David May 18 '23 at 13:25

0 Answers0