Hi,
I was curious if I can make the control work kinda like the Send button in Outlook. Basically what I want is for there to be, for example, is a text box, radSpell and a Save button. The user clicks on the save button, if there is any misspelled words, the spell check dialog pops up. If there are no spelling mistakes in the text box, then the dialog will not be displayed and the rest of the buttons code executes like normal.
EDIT - I've got a good start. Just for extra information, I want to do this with a normal text box and not the radEditor control.
I was curious if I can make the control work kinda like the Send button in Outlook. Basically what I want is for there to be, for example, is a text box, radSpell and a Save button. The user clicks on the save button, if there is any misspelled words, the spell check dialog pops up. If there are no spelling mistakes in the text box, then the dialog will not be displayed and the rest of the buttons code executes like normal.
EDIT - I've got a good start. Just for extra information, I want to do this with a normal text box and not the radEditor control.
2 Answers, 1 is accepted
0

Chris
Top achievements
Rank 1
answered on 11 Mar 2009, 08:33 PM
This is what I have right now. Cause I can't get it to work properly on the click of the button. For now I just set everything when the text box loses focus. Everything basically works except for the checkStarted method. In that method I want to see if I can check how many misspelled words there are. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" EnableEventValidation="true" %> |
|||||||||||||||||||||||||||||||
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> | |||||||||||||||||||||||||||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||||||||||||||||||||||||||||
<html xmlns="http://www.w3.org/1999/xhtml"> | |||||||||||||||||||||||||||||||
<head runat="server"> | |||||||||||||||||||||||||||||||
<title></title> | |||||||||||||||||||||||||||||||
</head> | |||||||||||||||||||||||||||||||
<body> | |||||||||||||||||||||||||||||||
<form id="testForm" runat="server"> | |||||||||||||||||||||||||||||||
<script language="javascript"> | |||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
</script> | |||||||||||||||||||||||||||||||
<telerik:RadScriptManager ID="radScriptManager" runat="server" /> | |||||||||||||||||||||||||||||||
<div> | |||||||||||||||||||||||||||||||
<asp:TextBox ID="txtSpellCheck" runat="server" TextMode="MultiLine" Height="100%" onblur="spellCheck();"></asp:TextBox> | |||||||||||||||||||||||||||||||
<asp:Button ID="btnSubmit" runat="server" style="display: none;" /> | |||||||||||||||||||||||||||||||
<asp:Label ID="lblTest" runat="server"></asp:Label> | |||||||||||||||||||||||||||||||
<telerik:RadSpell ID="radSpellChecker" runat="server" | |||||||||||||||||||||||||||||||
ControlToCheck="txtSpellCheck" ButtonType="None" | |||||||||||||||||||||||||||||||
FragmentIgnoreOptions="All" SpellCheckProvider="EditDistanceProvider" | |||||||||||||||||||||||||||||||
SupportedLanguages="en-US,English" WordIgnoreOptions="None" | |||||||||||||||||||||||||||||||
Skin="Office2007" | |||||||||||||||||||||||||||||||
OnClientCheckFinished="checkFinished" OnClientCheckStarted="checkStarted" OnClientCheckCancelled="checkCancelled" /> | |||||||||||||||||||||||||||||||
</div> | |||||||||||||||||||||||||||||||
</form> | |||||||||||||||||||||||||||||||
</body> | |||||||||||||||||||||||||||||||
</html> | |||||||||||||||||||||||||||||||
|
0
Hi,
The approach you have taken will get the job done. However, you can go one step further and don't show the spell dialog unless there are errors. For this to work, you will need to place a hidden RadEditor control on the page with only one tool - spell check. I have attached the updated example page to this message.
When the blur event of your textbox is fired, I use the editor's spell checking service to check the text. If there are no errors, I submit the page. If there are errors, I call the normal RadSpell control dialog and provide the user with suggestions for the misspelled words. From then its similar to your example - when the spell check dialog is closed (spell check is finished or canceled) I submit the page. The only difference is that I added a small timeout before submitting the page when the spell check is successfully finished. This way I can ensure that the textbox value is updated properly before it is sent to the server.
Sincerely yours,
Lini
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
The approach you have taken will get the job done. However, you can go one step further and don't show the spell dialog unless there are errors. For this to work, you will need to place a hidden RadEditor control on the page with only one tool - spell check. I have attached the updated example page to this message.
When the blur event of your textbox is fired, I use the editor's spell checking service to check the text. If there are no errors, I submit the page. If there are errors, I call the normal RadSpell control dialog and provide the user with suggestions for the misspelled words. From then its similar to your example - when the spell check dialog is closed (spell check is finished or canceled) I submit the page. The only difference is that I added a small timeout before submitting the page when the spell check is successfully finished. This way I can ensure that the textbox value is updated properly before it is sent to the server.
Sincerely yours,
Lini
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.