I want to be able to encrypt text in a textbox before submiting a form in facebook.I tried ajaxFORM plugin with beforeSerialize or with beforeSubmit but the encryption doesnt happen.In the code that follows the encrypt function is replaced with alert for debugging purposes.The alert comes right after i run the script and not when i press the submit button on facebook.Also when i press the submit button it asks to refresh the page and i dont want this.I want to be able to encrypt text in a textbox