Click here to Skip to main content
15,906,097 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the following code I am unable to avoid the flicker of cursor inside the textbox6. This TB is attached with a calender extender. The user should be allowed only to select the date for filling
in the TB. But in this code it also allows the user to enter some data. How to avoid this cursor inside TB6.

XML
<asp:TextBox ID="TextBox6" runat="server"    TabIndex="13" AutoPostBack="True" OnTextChanged="TextBox6_TextChanged"
style=" z-index: 1;top: 124px; left: 225px; position: absolute; height: 18px; width: 148px"></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtender1" runat="server"  TargetControlID="TextBox6"
Format="yyyy/MM/dd"> </asp:CalendarExtender>
Posted
Comments
The14thNoah 11-Feb-14 2:38am    
why not try to put a Validator to your textBox6,so if the user input something that is not a datetime datatype it wil clear/not accept the entered data. .
Sergey Alexandrovich Kryukov 11-Feb-14 2:54am    
What is "calender"? :-)
—SA

1 solution

make your textBox as
readonly=true
 
Share this answer
 
Comments
S.Rajendran from Coimbatore 11-Feb-14 2:51am    
Thanks.
S.Rajendran from Coimbatore 11-Feb-14 3:20am    
Now though that problem is OK because of 'Readonly=true' I get a new problem because of it. That is after I select the date it is not getting stored in that TB. The date blinks and disappears.
I use a breakpoint at Textbox6_textchanged but it does not enter that breakpoint also.
[no name] 11-Feb-14 3:46am    
here is my code i am not getting the same problem

<asp:TextBox ID="TextBox1" ReadOnly=true runat="server">
<asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"
Enabled="True" TargetControlID="TextBox1">

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900