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

Misspellings not Corrected on Form Submission

0 Answers 22 Views
Spell
This is a migrated thread and some comments may be shown as answers.
Jutas Arthasarnprasit
Top achievements
Rank 1
Jutas Arthasarnprasit asked on 20 Feb 2017, 04:22 PM

I have a form with a few textboxes and a save button.  I want RadSpellCheck to launch when the save button is clicked and then on the server execute the click event for the save button.  I don't want a separate button for the spell check.  When I run the page the RadSpellCheck dialog box appears and finds the misspellings but doesn't correct them when the form is submitted.

I appreciate any ideas you all have.

Here's the .aspx markup file:

 

<head runat="server">
    <title></title>
    <telerik:RadScriptBlock ID="script1" runat="server">
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript">
        function check() {
            Page_ClientValidate();
            if (Page_IsValid) {
                var spell = $find('<%= RadSpell1.ClientID %>');
                spell.startSpellCheck();
                return false;
            }
        }
        function RadSpell1_OnClientCheckFinished() {
            $("#<% =btnSaveReal.ClientID %>").trigger('click');
        }
    </script>
        </telerik:RadScriptBlock>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
         
     
    <div>
    <asp:TextBox id="txt1" runat="server">My firzt client side TEXTAREA with some delibirate mistakees.</asp:TextBox>
        <br />
        <asp:TextBox id="txt2" runat="server">My secont client side TEXTAREA with some delibirate mistakees.</asp:TextBox>
        <br />
        <asp:Textbox id="txt3" runat="server">My thirdth client side TEXTAREA with some delibirate mistakees.</asp:Textbox>
        <br />
        <asp:TextBox ID="txtTest" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="reqTest" ControlToValidate="txtTest" ErrorMessage="Required" runat="server"></asp:RequiredFieldValidator>
        <br />
        <telerik:RadSpell RenderMode="Lightweight" ID="RadSpell1" runat="server" ControlsToCheck="txt1,txt2,txt3" OnClientCheckFinished="RadSpell1_OnClientCheckFinished" IsClientID="true" ButtonType="None"></telerik:RadSpell>
        <asp:Button ID="btnSave" Text="Save" OnClientClick="return check()" runat="server" />
        <asp:Button ID="btnSaveReal" Text="Save" OnClick="btnSave_Click" style="display:none;" runat="server" />
        <asp:Button ID="btnDelete" Text="Delete" OnClick="btnDelete_Click" runat="server" />
    </div>
    </form>
</body>
</html>

 

Code Behind:

public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Response.Write(txt1.Text);
            }
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            Response.Write("Delete");
        }
    }

No answers yet. Maybe you can help?

Tags
Spell
Asked by
Jutas Arthasarnprasit
Top achievements
Rank 1
Share this question
or