added textarea formatting and expose encodeForm api