jQuery(document).ready(
function($) {
$('form').submit(
function() {
var sum2 = $('#ff_1_economia_um_ano').val().toLocaleString("pt-BR", {style: "currency", currency: "BRL", minimumFractionDigits: 2});
var sum3 = $('#ff_1_economia_colaborador').val().toLocaleString("pt-BR", {style: "currency", currency: "BRL", minimumFractionDigits: 2});
var sum4 = $('#ff_1_horas_economia_colaborador_ano').val().toLocaleString("pt-BR", {style: "currency", currency: "BRL", minimumFractionDigits: 2});
var splitName = $('#ff_1_nome').val();
var names = splitName.split(' ');
var firstName = names[0];
names.splice(0,1); // removes the first name from the array
var lastName = names.join(' '); // put any remaining values from array into lastName, separate with a space
$('#ff_1_nome_1').val(firstName);
$('#ff_1_nome_2').val(lastName);
$('#ff_1_economia_um_ano_formatado').val(sum2);
$('#ff_1_economia_colaborador_formatado').val(sum3);
$('#ff_1_horas_economia_colaborador_ano_formatado').val(sum4);
return true; }); });