I have a regular textbox that I change the input type to a date textbox when entered, so that I can have the placeholder inside of it, however, that causes the “SelectOnEnter” not to work.
' I'm doing this sender cast because I use the same events for multiple fields.
Private Sub DateTxtBox_Enter(sender As Object, e As EventArgs) Handles PaymentDateTxt.Enter
Dim TxtBox As TextBox = CType(sender, TextBox)
If TxtBox.Text.Length = 0 Then
TxtBox.InputType.Type = TextBoxType.Date
End If
End Sub
Private Sub DateTxtBox_Leave(sender As Object, e As EventArgs) Handles PaymentDateTxt.Leave
Dim TxtBox As TextBox = CType(sender, TextBox)
If TxtBox.Text.Length = 0 Then
TxtBox.InputType.Type = TextBoxType.Text
End If
End Sub
I set a breakpoint inside of the ‘click’ event, and that seems to be fired after the ‘enter’ event, so I tried selecting all inside of the click event, no success. Any suggestions? We prefer to use the textbox date input because of the picker style, and the placeholder.
Hi Kurt,
The placeholder is shown when the textbox is empty and the Date native textbox is managed by the browser, that means depending on what browser you’re using to test the textbox, it can’t be selected.
It’s not a Wisej.NET issue.
Best,
Alaa
Please login first to submit.