TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sreenish
NA
249
33k
Anyone Know?
Aug 10 2015 1:35 AM
did any one know how to validate time in textbox using two checkboxes .i mean 12hr in one checkbox and 24hr in another checkbox.if user clicks 12hr checkbox it should validate only 12 hr same for 24 hr..how to do this any idea help me.am posting what i have done.
Code:
<div>
<asp:TextBox ID="txtTime" runat="server">
</asp:TextBox>
<asp:CheckBox ID="Chk1" runat="server" Text="12hr" onclick="fnCheckOne(this)"
/>
<asp:CheckBox ID="Chk2" runat="server" Text="24hr" onclick="fnCheckOne(this)" />
<asp:RegularExpressionValidator ID="regex1" runat="server" ErrorMessage="InvalidTime"
ControlToValidate="txtTime" ValidationExpression="^(1[0-2]|0[1-9]):[0-5][0-9]\040(AM|am|PM|pm)$">
</asp:RegularExpressionValidator>
<asp:RegularExpressionValidator ID="regex2" runat="server" ErrorMessage="InvalidTime"
ControlToValidate="txtTime" ValidationExpression="^([01]?[0-9]|2[0-3]):[0-5][0-9]$">
</asp:RegularExpressionValidator>
</div>
Reply
Answers (
6
)
get device screen size in asp.net mvc
How to change ASP.NET Web Form site default SQL Schema???