Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: Force spellchecker to run?
Force spellchecker to run?
Last post 10-20-2010, 8:49 PM by
Kenneth
. 6 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
08-30-2010, 11:41 PM
63742
cheryll
Joined on 06-21-2005
Posts 53
Force spellchecker to run?
Reply
Quote
Hi
Is it possible to force the spell checker to run using a field outside of the editor window?
ie you enter your text and want to save/submit it - but want the spellchecker to come up automatically without having to push the Editor button?
Thanks
Cheryl
08-31-2010, 1:13 AM
63743
in reply to
63742
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: Force spellchecker to run?
Reply
Quote
Hi cheryll,
Please try the example below.
<%@ Page Language=
"C#"
%>
<%@ Register Namespace=
"CuteEditor"
Assembly=
"CuteEditor"
TagPrefix=
"CE"
%>
<!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 id=
"Head1"
runat=
"server"
>
<title>Untitled Page</title>
</head>
<body>
<script runat=
"server"
>
protected
override
void
OnLoad(EventArgs e)
{
editor1.Text =
"aaa bbb"
;
base
.OnLoad(e);
}
</script>
<form id=
"form1"
runat=
"server"
>
<CE:Editor ID=
"editor1"
runat=
"server"
>
</CE:Editor>
<input type=
"button"
value=
"Save text"
onclick=
"save()"
/>
</form>
</body>
</html>
<script>
function save()
{
var editor1=document.getElementById(
"<%= editor1.ClientID %>"
);
editor1.ExecCommand(
"NetSpell"
);
}
</script>
Regards,
ken
08-31-2010, 7:14 PM
63765
in reply to
63743
cheryll
Joined on 06-21-2005
Posts 53
Re: Force spellchecker to run?
Reply
Quote
Thanks for the example Ken
The only problem is that after the Spellchecker window is closed, i then need to invoke a codebehind method.
Any ideas as to how I would do that?
Thanks
Cheryl
08-31-2010, 9:40 PM
63770
in reply to
63765
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: Force spellchecker to run?
Reply
Quote
hi cheryll,
Try the new example
<%@ Page Language=
"C#"
%>
<%@ Register Namespace=
"CuteEditor"
Assembly=
"CuteEditor"
TagPrefix=
"CE"
%>
<!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 id=
"Head1"
runat=
"server"
>
<title>Untitled Page</title>
</head>
<body>
<script runat=
"server"
>
protected
override
void
OnLoad(EventArgs e)
{
editor1.Text =
"aaa bbb"
;
base
.OnLoad(e);
}
protected
void
button1_Click(
object
sender, EventArgs e)
{
//Execute your codebehind method here
label1.Text =
"codebehind method achieve"
;
}
</script>
<form id=
"form1"
runat=
"server"
>
<CE:Editor ID=
"editor1"
runat=
"server"
>
</CE:Editor>
<input type=
"button"
value=
"Save text"
onclick=
"save()"
/>
<asp:Button ID=
"button1"
runat=
"server"
Style=
"visibility: hidden"
OnClick=
"button1_Click"
/>
<asp:Label ID=
"label1"
runat=
"server"
ForeColor=
"red"
></asp:Label>
</form>
</body>
</html>
<script>
function save()
{
var editor1=document.getElementById(
"<%= editor1.ClientID %>"
);
var button1=document.getElementById(
"<%= button1.ClientID %>"
);
editor1.ExecCommand(
"NetSpell"
);
button1.click();
}
</script>
Regards,
ken
08-31-2010, 9:46 PM
63771
in reply to
63770
cheryll
Joined on 06-21-2005
Posts 53
Re: Force spellchecker to run?
Reply
Quote
Oh dear! looking at your code the answer is SO obvious!
Thanks very much Ken, I'll give it a go.
10-19-2010, 10:42 PM
64515
in reply to
63771
cheryll
Joined on 06-21-2005
Posts 53
Re: Force spellchecker to run?
Reply
Quote
Hi Ken
I have this solution working quite well thanks very much, however i have noticed that it spell checks any style - is there a way to limit the spellchecker to check only the plaintext?
10-20-2010, 8:49 PM
64541
in reply to
64515
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: Force spellchecker to run?
Reply
Quote
Hi cheryll,
For now spellcheck does not support this model. Sorry for your inconvenience.
Regards,
Ken