This is a migrated thread and some comments may be shown as answers.

Spell Check not happening on asp text box

7 Answers 142 Views
Spell
This is a migrated thread and some comments may be shown as answers.
Akki
Top achievements
Rank 1
Akki asked on 11 Jun 2012, 04:34 PM

Any reply on this ?
Hi ,

I have a scenario where i need to do spell check for text entered in Asp textbox.. I am using combination of textbox and radspell
as below. But this is not working.

        function SpellCheckDone() {
var radTextBox1 = document.getElementById("<%=rdTxtBox.ClientID %>")
radTextBox1.updateDisplayValue();
}


 <asp:TextBox ID="rdTxtBox" runat="server" TextMode="MultiLine"></asp:TextBox>
            <telerik:RadSpell ID="rdspell1" runat="server" ControlToCheck="rdTxtBox" SpellCheckProvider="PhoneticProvider"
            SupportedLanguages ="en-US,English" OnClientDialogClosed="javascript:SpellCheckDone()" ButtonType="None"/>

Do i need to do anything further. Please help.

Regards,
Akki

7 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 13 Jun 2012, 03:49 PM
Hi,

The OnClientDialogClosed event of RadSpell is fired when closing RadSpell dialog.
The updateDisplayValue() method is not needed, because the standard ASP.NET TextBoxes do not have such a client side method.

What you should do is to set
<telerik:RadSpell ID="RadSpell1" runat="server" ControlsToCheck="TextBox1" />
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox>

When pressing the Spell Check button, RadSpell will be opened and the user will be able to spellcheck the contents of the textbox.

If you want to launch the spellchecker when the textbox loses focus, you should attach to its blur event and launch the spellchecker, e.g.

<telerik:RadSpell ID="RadSpell1" runat="server" ControlsToCheck="TextBox1" />
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox>
<script type="text/javascript">
function pageLoad() {
    $telerik.$("#TextBox1").on("blur", function (e) {
        GetRadSpell('<%= RadSpell1.ClientID %>').startSpellCheck();
    });
}
</script>



All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Akki
Top achievements
Rank 1
answered on 13 Jun 2012, 04:10 PM
Hi Rumen,
Thanks for reply. I wanted spell check when textbox onblur event and implemented as suggested by you.
But i get a script error "Microsoft JScript runtime error: Object doesn't support this property or method" twice
Once on Page load and on blur event
Can i know how to get the"$telerik".

I'm not able to find the
"$telerik.$("#TextBox1").on("blur", function (e) {
        GetRadSpell('<%= RadSpell1.ClientID %>').startSpellCheck();
"

Regards,
Akki

My code is below

<body>
<script type="text/javascript">
    function pageLoad() {debugger;
        $telerik.$("#TextBox1").on("blur", function (e) {
            GetRadSpell('<%= RadSpell1.ClientID %>').startSpellCheck();
        });
    }
</script>
    <form id="form1" runat="server">
<asp:ScriptManager ID="mgr" runat="server"></asp:ScriptManager>
    <div>
        <telerik:RadSpell ID="RadSpell1" runat="server" ControlsToCheck="TextBox1" ButtonType="None" />
        <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" onblur="javascript:pageLoad();"></asp:TextBox>
    </div>
    </form>
</body>
0
Shinu
Top achievements
Rank 2
answered on 14 Jun 2012, 09:22 AM
Hi Akki,

Here is the sample code that I tried which worked as expected.
aspx:
<telerik:RadSpell ID="RadSpell1" runat="server" ControlsToCheck="TextBox1" ButtonType="None" />
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" ></asp:TextBox>
JS:
<script type="text/javascript">
    function pageLoad() {
        $telerik.$("#TextBox1").on("blur", function   {
            GetRadSpell('<%= RadSpell1.ClientID %>').startSpellCheck();
        });
    }
</script>

Thanks,
Shinu.
0
Akki
Top achievements
Rank 1
answered on 14 Jun 2012, 01:33 PM
Hi shinu ,
I m not getting "$telerik" in javascript.. $telerik comes with jquery ? or do i need to do anything ?

Regards,
AKki
0
Rumen
Telerik team
answered on 14 Jun 2012, 04:37 PM
Hello,

Yes, jQuery is integrated in the RadControls for ASP.NET AJAX suite and you can find more information in the documentation:



 For your convenience I have attached my test project that works fine on my end.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Akki
Top achievements
Rank 1
answered on 15 Jun 2012, 10:21 AM

Thanks very much Rumen and Shinu,
Code you have suggested worked for me .. One Change i had to do is add Scripts tag inside script manager.
    <asp:ScriptManager ID="scrptmgr" runat="server">
    <Scripts>
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
    </Scripts>

One change required is .. now new pop up is opening for spell suggestions ..i want inline suggestions as attached in file named "required".

What changes i have to do to achieve this ?

Regards,
Akki



0
Accepted
Rumen
Telerik team
answered on 16 Jun 2012, 10:28 AM
Hello,

The inline suggestions shown in required.png are actually provided by the built-in browser's spellchecker which is offered by all browsers excepts Internet Explorer. Since this feature will be supported by the upcoming IE10 we do not plan to provide such functionality in RadSpell.

If you would like you can replace the textboxes with RadEditor and use its inline spellchecker. You can configure RadEditor to looks like a textarea as shown in this demo: Displaying RadEditor as a TextBox.

Regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Spell
Asked by
Akki
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Akki
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or