Hello,
I have a RadGrid with a UserControl for the Edit command. That UC contains both a RadToolbar and a RadEditor. I want to verify client-side that the Editor contains some text when the user clicks a toolbar button. I've subscribed to the OnClientButtonClicking event for the toolbar. However, when the UC opens, I get a JavaScript error that 'OnClientButtonClicking' is undefined.
Here is the declaration for the OnClientButtonClicking handler:
And here are the declarations for the RadEditor and RadToolbar:
Again, the UC is opened for the Edit command of a RadGrid.
Thanks in advance for your help!
Jeff
I have a RadGrid with a UserControl for the Edit command. That UC contains both a RadToolbar and a RadEditor. I want to verify client-side that the Editor contains some text when the user clicks a toolbar button. I've subscribed to the OnClientButtonClicking event for the toolbar. However, when the UC opens, I get a JavaScript error that 'OnClientButtonClicking' is undefined.
Here is the declaration for the OnClientButtonClicking handler:
<script type="text/javascript"> |
function OnClientButtonClicking(sender, args) |
{ |
if (args.get_item().get_value() == "save") { |
var editor = $find("<%=reComments.ClientID%>"); |
if (editor.get_text() == "") { |
window.alert("You must enter Comments in order to have your request reviewed!"); |
args.set_cancel(true); |
} |
} |
} |
</script> |
And here are the declarations for the RadEditor and RadToolbar:
<telerik:radeditor |
Skin="WebBlue" |
EditModes="Design" |
Width="80%" |
Height="250px" |
StripFormattingOnPaste="All" |
ID="reComments" |
runat="server" |
toolsfile="~/ToolsFile.xml" |
StripFormattingOptions="All"> |
<CssFiles><telerik:EditorCssFile Value="~/css/EditorContentArea.css" /></CssFiles> |
<Content> |
</Content> |
</telerik:radeditor> |
<telerik:radtoolbar OnClientButtonClicking="OnClientButtonClicking" Skin="Vista" Font-Names="Verdana" AutoPostBack="true" runat="server" id="Radtoolbar2"> |
<items> |
<telerik:RadToolBarButton CommandArgument="save" CommandName="save" Enabled="false" ForeColor="White" Text="Submit Request" ImageUrl="../../images/save.gif" runat="server" ToolTip="Click here to submit your request to your supervisor." /> |
<telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton> |
<telerik:RadToolBarButton CommandArgument="cancel" ForeColor="White" Text="Cancel & Return to Competency List" ImageUrl="../../images/back.gif" runat="server" ToolTip="Click here to cancel any changes made and return to the list of competencies." CommandName="Cancel" /> |
</items> |
</telerik:radtoolbar> |
Again, the UC is opened for the Edit command of a RadGrid.
Thanks in advance for your help!
Jeff