如何检查文本框中输入的单词是否拼写正确?

I have a textbox input type="text" maxlength="30".

A user is allowed to enter one word only in this textbox. How can I force the user to enter the right spelling?

It should show a message stating "wrong spelling" when a user enters the wrong spelling... Otherwise, the user can go ahead and submit... Any help is greatly appreciated.

Check this out. It will let you add the spell check to your textbox in a few easy steps.

If I've understood you correctly, and there is only going to be one possible word that you are looking for, then just check if the entered value is equal to that (e.g. if(inputValue == 'Word'))

There are various third party components for spell check suport:

You can also look into the built-in support (PHP 5.3+) for the Enchant library, although this still requires a spell-checking backend like Aspell.

It sounds like from your post you are trying to catch the input value matching before the form is submitted.

What i want is it should show a message wrong spelling when user enters wrong spelling... Otherwise user can go ahead and submit...

If so, this sounds like a job for javascript/AJAX. You have the script check against a value that could be stored server side (for security?) on either on a key press up or blur event handler. This script could also handle displaying messages back to the user as well, based on the return value of the AJAX call or whatnot. This could also be used to enable/disable the submit button too.