Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript spellchecker

    I know there are very viable solutions such as IEspell or FFox, but I don't have those options. I can not have users installing other applications/plug-ins.

    So I thought that another solution would be JS using a txt file or .dic file containing the English dictionary, words spaced by new lines, and having the spell checker token each word and parse it against the txt file. The function will be triggered by a button click. Not sure how I am going to highlight/focus the word to show the misspelled word and that is why I am here.

    Also, my above method is also very gimp/insufficient. A hashtable/other search mechanism would be nice, any suggestions? linear search is dreadful. Common words like 'you', 'to', 'we' will have to traverse over 100,000 words. And the client side nature of JS is unsettling. Perhaps it won't be so bad, each user will be using IE6 and higher (possibly FF) and at least 512 RAM.

    Thanks your for input.

  • #2
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    vbulletin has a plugin like this that stores the words in a mysql database table. That may help if you can find the table sql file, have just had a look n i can't find it on my hd but i think you can download it from www.vbulletin.org.

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well I suppose I could throw the dictionary into an Access DB table.
    But the way my software is working is I am using a ODBiC (open database interenet connector) program (CGI) with my MS Access DB. I am running JS for validation with my htm pages. I can not change this architecture, I would love to, but can not.

    I do not have a way of checking the page's current state with ODBiC to check the dictionary table. I.E. I can not pass the document.form.text.value field into my sql script(it uses the <!-- --> commenting and checks for key words for triggers of ODBiC).

    And again, I can not have users installing plugins.

  • #4
    Regular Coder GO ILLINI's Avatar
    Join Date
    Jun 2005
    Location
    USA
    Posts
    634
    Thanks
    0
    Thanked 7 Times in 7 Posts
    simple... Use ajax to talk to php to

    Text box --> Ajax --> PHP file --> DB --> PHP --> Ajax --> display what you want
    (im sure(maybe?) that ajax works with asp too if thats what you want)

    The php file would take the text and check every word and add html to format the color and whatever(links,popups,...) then the php file sends the new text back to the javascript (ajax) and your done!

    This looks like what you want:
    http://www.broken-notebook.com/spell_checker/index.php

    -Adam
    Why not thank me?

    http://adamsworld.name

  • #5
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well text boxes only have properties that can change the background colors. I need a way to select the text in the box. I'll look into AJAX, always wanted to.

    I'll have to look into more types of text areas for capabilities.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •