or
<td align="right" height="30"> <telerik:RadButton ID="RadButton3" runat="server" ButtonType="LinkButton" OnClick="orderupdate_Click" PressedCssClass="buttonpressed" HoveredCssClass="buttonpressed"> </telerik:RadButton> </td>.buttonpressed { background-color: #000000 !important; }<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <telerik:RadAjaxManager ID="RadAjaxManager2" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="btnSubmit"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="Panel1" UpdatePanelCssClass="" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"> </telerik:RadAjaxLoadingPanel> <telerik:RadFormDecorator id="FormDecorator1" runat="server" DecoratedControls="All" Skin="Metro"></telerik:RadFormDecorator> <asp:Panel runat="server" ID="Panel1"> <table> <tr> <td class="auto-style5"> <label>Father's Name:</label> </td> <td style="width:100px"> <telerik:RadTextBox ID="txtFathersName" Runat="server" EmptyMessage="Father's Name" LabelWidth="64px" Resize="None" Width="160px" DisabledStyle-BackColor="Silver"> </telerik:RadTextBox> </td> <td><asp:CustomValidator runat="server" ID="CustomFieldValidator1" ControlToValidate="txtFathersName" ClientValidationFunction="RequiredIfPhysical" ErrorMessage="<img src='images/Exclamation.png' Title='Required Field'/>" ValidateEmptyText="True" Display="Dynamic" ></asp:CustomValidator> </td> </tr> <tr> <td class="auto-style5"> <label>City:</label> </td> <td class="auto-style6"> <telerik:RadTextBox ID="txtCity" Runat="server" EmptyMessage="City" LabelWidth="64px" Resize="None" Width="160px" Wrap="False" CausesValidation="False"> </telerik:RadTextBox> </td> <td><asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtCity" runat="server" ErrorMessage="<img src='images/Exclamation.png' Title='Required Field'/>" Display="Dynamic" ></asp:RequiredFieldValidator></td> </tr> </table> </asp:Panel>
Further below there is also the javascript validator:
<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
<script type="text/javascript">
function RequiredIfPhysical(sender, args) {
var chkBoxPhysical = $find("<%=rdBtnPhysical.ClientID%>");
chkBoxPhysical = $telerik.toButton(chkBoxPhysical);
if (chkBoxPhysical.get_checked()) {
if (args.Value == "") {
args.IsValid = false;
}
else {
args.IsValid = true;
}
} else {
args.IsValid = true;
}
}
</script>
</telerik:RadCodeBlock>
<telerik:RadDockLayout ID="RadDockLayout2" runat="server"> <telerik:RadDockZone ID="RadDockZone3" runat="server" Height="300px" Width="300px"> <telerik:RadDock ID="RadDock3" runat="server" Width="300px" Title="Dock1" Text="Dock1"> <Commands> <telerik:DockExpandCollapseCommand /> </Commands> <ContentTemplate> --Contents here--- </ContentTemplate> </telerik:RadDock> </telerik:RadDockZone> <telerik:RadDockZone ID="RadDockZone4" runat="server" Height="300px" Width="300px"> <telerik:RadDock ID="RadDock4" runat="server" Width="300px" Title="Dock2" Text="Dock2"> <Commands> <telerik:DockExpandCollapseCommand /> </Commands> <ContentTemplate> --Contents here--- </ContentTemplate> </telerik:RadDock> </telerik:RadDockZone> <telerik:RadDockZone ID="RadDockZone5" runat="server" Height="300px" Width="300px"> <telerik:RadDock ID="RadDock5" runat="server" Width="300px" Title="Dock2" Text="Dock2"> <Commands> <telerik:DockExpandCollapseCommand /> </Commands> <ContentTemplate> --Contents here--- </ContentTemplate> </telerik:RadDock> </telerik:RadDockZone> </telerik:RadDockLayout>