refatorando form javascript