Greetings,
So, the problem I'm having right now is an odd one, or at least to me. I have a page with a RadGrid in it, that has it's editmode turned to popup that calls a control of mine. Upon the window appearing, I get a javascript error. This error comes from some javascript that I'm trying to add within a radToolBar. Here is what I have.
Prior to adding the javascript codeblock, the page worked, but I need to check txtComment to find out if it has anything in itself or not on the clientside so I can do an alert. Is there a way to do this? Thanks.
Chad
So, the problem I'm having right now is an odd one, or at least to me. I have a page with a RadGrid in it, that has it's editmode turned to popup that calls a control of mine. Upon the window appearing, I get a javascript error. This error comes from some javascript that I'm trying to add within a radToolBar. Here is what I have.
<script type="text/javascript"> |
function onClientButtonClick(sender, args) |
{ |
var btn = args.get_item(); |
if (btn.get_commandName() == "PerformInsert") |
{ |
var txt = $find("ctl00_ctl00_cphContent2_cphAITContent_rgdComments_ctl00_ctl02_ctl03_EditFormControl_txtComment_text"); |
var temp = txt.value.replace('/^\s+|\s+$/g', ''); |
if (temp.value.length == 0) |
{ |
alert("You must enter text in order to add/edit your comment."); |
} |
} |
} |
</script> |
<telerik:RadToolBar ID="rtbCommentText" runat="server" OnButtonClick="rtbCommentText_ButtonClick" |
OnClientButtonClicked="onClientButtonClick"> |
<Items> |
<telerik:RadToolBarButton CommandName="PerformInsert" Text="Save" SkinID="SaveBtn"> |
</telerik:RadToolBarButton> |
<telerik:RadToolBarButton CommandName="Cancel" Text="Cancel" SkinID="CancelBtn"> |
</telerik:RadToolBarButton> |
</Items> |
</telerik:RadToolBar> |
<br /> |
<telerik:RadTextBox ID="txtComment" runat="server" TextMode="MultiLine" Width="500px" Height="250px"> |
</telerik:RadTextBox> |
Prior to adding the javascript codeblock, the page worked, but I need to check txtComment to find out if it has anything in itself or not on the clientside so I can do an alert. Is there a way to do this? Thanks.
Chad