One problem is when you click the submit button.
For example if you write
when you click the link it will go to a1.
Replace the submit button with a normal one (type="button").
Other errors can be present but I think this is the problem.
Try to debug the code. Place alerts before and after every line from the function crypt and see if it gets there.
A teeny tiny vulgar attempt to get you to buy our stuff
Download Free Java APIs to Work with Office Files and PDF