RadSpell

5 posts, 2 answers
  1. karthik
    karthik avatar
    3 posts
    Member since:
    Jul 2014

    Posted 15 Jul 2014 Link to this post

    Hi,

    I have a radspell with controlToCheck(Textbox1) in my web form..i want to activate the radspellcheck on button onclientclick event because button  also have onclick event..i need to fire the radspellcheck before button onclick event...Simply i want a spellcheck on button submit...i have tried but onclick event only fired fiirst..could please some example please...
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 16 Jul 2014 Link to this post

    Hello,

    You need to cancel the postback, let the spellcheck work and initiate the postback again when it finishes. Otherwise, the postback will dispose the spell because it works on the client.

    There are various ways to do this and perhaps this KB article will help you with one approach: http://www.telerik.com/support/kb/aspnet-ajax/spell/details/invoke-separate-spell-check-for-each-textbox-and-submit-the-form-on-success.

    Another suggestion is to use the client-side API and events of the control:

    For your convenience I prepared a small example here:

    <asp:TextBox ID="Textbox1" runat="server" Text="miztakes" />
    <telerik:RadSpell ID="RadSpell1" runat="server" ControlToCheck="Textbox1" ButtonType="None" OnClientCheckFinished="invokePostback" />
    <asp:Button ID="Button1" Text="check and submit" OnClientClick="invokeSpellCheck(this); return false;" OnClick="Button1_Click" runat="server" />
    <script type="text/javascript">
        function invokeSpellCheck(btn) {
            var spell = $find("<%=RadSpell1.ClientID %>");
            spell.__customButtonReference = btn;
            spell.startSpellCheck();
        }
         
        function invokePostback(sender, args) {
            if (sender.__customButtonReference) {
                __doPostBack(sender.__customButtonReference.getAttribute("name"), "");
            }
        }
    </script>


    Regards,

    Marin Bratanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Jul 2014 in reply to karthik Link to this post

    Hi Karthik,

    Please try to attach the OnClientDialogClosed event of RadSpell and try to call the OnClick event of RadButton from OnClientDialogClosed event as follows and also set the AutoPostBack property of RadButton as false.

    JavaScript:
    function finishCheck(sender, args) {
        button = $find("<%=rbtnSpellCheck.ClientID%>");
        __doPostBack(button.get_id(), "OnClick");
     
    }

    Thanks,
    Shinu.
  5. karthik
    karthik avatar
    3 posts
    Member since:
    Jul 2014

    Posted 17 Jul 2014 in reply to Shinu Link to this post

    Hi Shinu,

    Thank you so much...it works fine...
  6. karthik
    karthik avatar
    3 posts
    Member since:
    Jul 2014

    Posted 17 Jul 2014 in reply to Marin Bratanov Link to this post

    hi Marin Bratanov,

    Thank you so much for the sample..It works after adding the Shinu point...
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017