How to check spelling of user typed text in a form textbox
You can use HTML spellcheck Attribute for the textfield. The spellcheck attribute is new in HTML5.


  The spellcheck attribute specifies whether the element is to have its spelling and grammar checked or not.


You can use this attribute in your textfield like follows. I've tested this and working fine.

  $form['check'] = array(
        '#type' =&gt; 'textfield',
        "#attributes" =&gt; array("spellcheck" =&gt; "true")
      );