Welcome Guest Search | Active Topics | Sign In | Register

Spell check multiple text boxes with javascript function using SpellChecker.start() Options
Darrell Reinke
Posted: Friday, July 18, 2008 7:41:38 AM
Rank: Advanced Member
Groups: Member

Joined: 7/18/2008
Posts: 76
Good Morning.

I am currently in the process of evaluting your full suite of objects and I have a question about the functionality of the spell checker object.

I need to be able to spell check multiple objects on the same webpage through one javascript function.

Example:
SpellCheckAllObjects(){
SpellCheck1.start()
SpellCheck2.start()
etc...
}

If you envoke this script it will only spell check the text box tied to the SpellCheck2 object.

Please let me know if it is possible to create javascript that will spell check multiple objects on the same page (start on spell check, once complete, move on to the next text box object).

Thank you for your time.
eo_support
Posted: Friday, July 18, 2008 9:39:17 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Hi,

Thanks for posting in the forum. We looked into it and noticed that you can use spell checker on multiple static text elements but not textbox because there is a small bug prevent it from being used on multiple text element, which we should be able to fix very quickly.

Our SpellChecker supports two ways of displaying errors: context menu or dialog. Context menu works fine with multiple SpellCheckers but it only works on static text elements since there is no way to in place highlight words in a textbox.

When SpellChecker uses dialog to display result, the second SpellChecker must be started after the first dialog closes, not when the first SpellChecker starts. This can be achieved by setting the first SpellCheckerDialog's ClientSideOnEnd to a function:

Code: HTML/ASPX
<eo:SpellCheckerDialog ClientsideOnEnd="start_spellchecker2" ...>
....
</eo:SpellCheckerDialog>


Code: JavaScript
function start_spellchecker2()
{
    SpellChecker2.start();
}


This way you would start the first spell checker, it then displays the errors in a dialog. As soon as user closes that dialog, the second spell checker starts and present another dialog for the errors in the second textbox.

Unfortunately there is a bug that prevents this flow from working correctly. The bug has already been fixed internally but we have not posted the fix yet. Please let us know if you are interested in receiving a new build that fixed this issue.

Even after the issue is fixed, you will see two dialogs instead of one. The first dialog is for results for the first textbox, then the first dialog closes, then the second one appear. Please let us know if this is something that you had in mind as to how multiple spellcheckers should work. If you were thinking about something else, please let us know, we will be happy to look into it and see if what we can do.

Thanks
Darrell Reinke
Posted: Friday, July 18, 2008 10:53:28 AM
Rank: Advanced Member
Groups: Member

Joined: 7/18/2008
Posts: 76
Thank you for your quick response. Yes, I would be interested in downloading the fix to view the functionality.

My overall vision for the spell checker, which I have seen in other spell checker .NET products, is that it would open only one spell check dialog and navigate through all of the objects without having to close one out to open another. I understand that the fix will seemlessly navigate through all of the text boxes by using the method you described, but having to close out multiple spell check boxes might not be accepatable for the users of the application we are currently developing. Once I get the my sample code working with the new downloaded objects, I will check with our end users to see if your solution is acceptable.

I just have one other question, is there anyway to supress the "Spell Check Complete" alert if there are no spelling errors? That functionality would be nice as well, especially if you are having to spell check multiple text boxes on one page. I don't want my users to have to click on "Spell Check Complete" multiple times if no errors were found.

Thank you again.

eo_support
Posted: Friday, July 18, 2008 11:02:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Hi,

Thank you very much for your valuable input. We have thought about using one dialog for multiple elements, but we were concerned about that user may get confused about which textbox they are currently deal with since no visual feedbacks are displayed on the textbox itself. If you have any thought on that please let us know.

"Spell Check Complete" can be customized. We added a new ClientSideOnMessage event in the new build (which you do not have yet) and you can handle that event to display your version of the message, or not to display any error message at all.

Code: HTML/ASPX
<eo:SpellChecker ClientSideOnMessage="message_handler" ...>
</eo:SpellChecker>


Code: JavaScript
function message_handler(control, name, message)
{
    if (name == "no_error")
        return;    //silent "no_error" message
}


We will try to get the new build to you as soon as possible. Hopefully late today.

Thanks
Darrell Reinke
Posted: Friday, July 18, 2008 11:29:29 AM
Rank: Advanced Member
Groups: Member

Joined: 7/18/2008
Posts: 76
I have been discusssing that topic with another programmer in our department and we don't think that the end user would necessarily care to know which section they were spell checking as long as they know that the entire entry screen was being spell checked.

Side note on this topic: Would there possibly be a way to display at the top of the Spell Check Dialog box the name of the object you were checking? For example, could you take the description supplied in the ToolTip of the text box to display in the SP Dialog Screen and if a ToolTip was not supplied, then place the actual name of the object (which would be ugly) or just leave it blank?
eo_support
Posted: Friday, July 18, 2008 11:35:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Darrell Reinke wrote:
Would there possibly be a way to display at the top of the Spell Check Dialog box the name of the object you were checking? For example, could you take the description supplied in the ToolTip of the text box to display in the SP Dialog Screen and if a ToolTip was not supplied, then place the actual name of the object (which would be ugly) or just leave it blank?


That sounds like a good idea. We will look into it and see if we can put it in. Note this will not be in the build that you will receive today; Rather we will look into it and see if we can put in our next build. I do expect it to be implemented because it makes perfect sense to the end user.
eo_support
Posted: Friday, July 18, 2008 3:26:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Hi,

We have posted a new build that would allow you start the second dialog when the first dialog closes. Please see your private message for the download location.

We will look into merging two dialogs into one and post again once we implement that.

Thanks!
Darrell Reinke
Posted: Monday, July 21, 2008 7:39:15 AM
Rank: Advanced Member
Groups: Member

Joined: 7/18/2008
Posts: 76
Thank you once again for how quickly you have responded. The new build works just as advertised. Using the "ClientsideOnEnd" event seemlessly moves from object to object. I have chosen to label the header of each spelling dialog appropriately so that the user knows which object they are spell checking.

Thank you again for your help, we will definately be purchasing your product.
eo_support
Posted: Monday, July 21, 2008 10:07:24 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Thank you very much for the update. Very glad to hear that. We are still considering allowing specifying multiple controls via ControlToCheck property, for example, "TextBox1,TextBox2". That way the checker will be able to go through all objects with one dialog. We will reply here again once that is implemented.

Please feel free to let us know if you need anything else!
Darrell Reinke
Posted: Thursday, July 24, 2008 8:54:54 AM
Rank: Advanced Member
Groups: Member

Joined: 7/18/2008
Posts: 76
I think I have found an issue with the spell checker. I have created a web page with three textboxes and the first time I kick off the spell check it iterates through the text boxes and corrects all of the misspelled words correctly. However, if you run the spell check again, it will concatonate random words together or add extra letters to words.

For example:
This sample uses a dialog to display the spell errors. Please refer to the product documentation under section "Using Spell Checker Dialog" for more details. (This is the text after the first time through spell checking. All of the words have spelling errors have been corrected)

If you kick off the spell check again, it concatonates differents words together or adds letters to different words:
This sample uses a dialog to display the spell errors. Please refer to the product documentationn under section "Using Spell Checker Dialog" for moredetailss.

(Please notice the words "documentationn" and "moredetailss").

Thank you for your time.
eo_support
Posted: Thursday, July 24, 2008 9:01:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Thanks for letting us know! We will look into it and see what we can find.
eo_support
Posted: Thursday, July 24, 2008 6:50:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Hi,

We have posted a new build that fixed this problem. Please see your private message for download location.

Thanks!
mephoenix
Posted: Friday, September 12, 2008 1:48:14 PM
Rank: Newbie
Groups: Member

Joined: 9/12/2008
Posts: 5
Hi,
I am trying to use the SpellCheck.start function, but I am not having much success. Is this the proper syntax to use inside of a javascript function?

on the kick off button: OnClientClick="start_spellchecker();"

function start_spellchecker()
{
eo_GetObject("SpellCheckerTest").start;
}

<eo:SpellChecker ID="SpellCheckerTest" runat="server" DialogID="SpellCheckerDialog1"
ControlToCheck="lblLabel" ContextMenuID="ContextMenu2">
</eo:SpellChecker>

<eo:ContextMenu runat="server" ID="ContextMenu2" Width="100px" ControlSkinID="None">
<LookItems>
<eo:MenuItem HoverStyle-CssText="color:#F7B00A;padding-left:5px;padding-right:5px;"
ItemID="_TopLevelItem" NormalStyle-CssText="padding-left:5px;padding-right:5px;">
<SubMenu Style-CssText="border-right: #e0e0e0 1px solid; padding-right: 3px; border-top: #e0e0e0 1px solid; padding-left: 3px; font-size: 12px; padding-bottom: 3px; border-left: #e0e0e0 1px solid; cursor: hand; color: #5f7786; padding-top: 3px; border-bottom: #e0e0e0 1px solid; font-family: arial; background-color: #f7f8f9"
OffsetX="-3" ShadowDepth="0" OffsetY="3" ItemSpacing="5">
</SubMenu>
</eo:MenuItem>
<eo:MenuItem IsSeparator="True" ItemID="_Separator" NormalStyle-CssText="width: 1px; height: 1px; background-color:#e0e0e0;">
</eo:MenuItem>
<eo:MenuItem HoverStyle-CssText="color:#F7B00A;padding-left:5px;padding-right:5px;"
ItemID="_Default" NormalStyle-CssText="padding-left:5px;padding-right:5px;">
<SubMenu Style-CssText="border-right: #e0e0e0 1px solid; padding-right: 3px; border-top: #e0e0e0 1px solid; padding-left: 3px; font-size: 12px; padding-bottom: 3px; border-left: #e0e0e0 1px solid; cursor: hand; color: #5f7786; padding-top: 3px; border-bottom: #e0e0e0 1px solid; font-family: arial; background-color: #f7f8f9"
OffsetX="3" ShadowDepth="0" OffsetY="-4" ItemSpacing="5">
</SubMenu>
</eo:MenuItem>
</LookItems>
</eo:ContextMenu>

If it is not, would you please provide the proper syntax. Or if there is a way to kick off the spellcheck in the codebehind, would you please provide that syntax.

Thanks
Darrell Reinke
Posted: Friday, September 12, 2008 2:06:11 PM
Rank: Advanced Member
Groups: Member

Joined: 7/18/2008
Posts: 76
This should be sufficient for starting your spellchecker object:

Code: JavaScript
function start_spellchecker()
{
    SpellCheckerTest.start(); 
}
eo_support
Posted: Friday, September 12, 2008 2:30:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Thank you very much for sharing!
mephoenix
Posted: Friday, September 12, 2008 2:37:57 PM
Rank: Newbie
Groups: Member

Joined: 9/12/2008
Posts: 5
Thanks for the quick response.

I tried putting in your code as advised but received the following error:

Microsoft JScript runtime error: 'SpellCheckerTest' is undefined
eo_support
Posted: Friday, September 12, 2008 2:42:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
To mephoenix:

You missed Darrell's point. The real difference is between "start()" and "start". Not between eo_GetObject("SpellCheckerTest") and "SpellCheckerTest". "start" is a function, so you would call it as function. Referecing it without "()" would do nothing.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.