Problem with an auto Insert

Hello, I again am, I have a problem with a form, the operation is simple, I have a field where the product code is captured, it searches my database and I want to insert into another table, the problem is that the insert them done twice, I have some screenshots

The event is in MyField_onChange

sc_lookup(dataset, "SELECT campo1, campo2, campo3
FROM t_tabla
WHERE C_CodValv = '{C_CapturarValvula}'");

// SQL statement parameters
	$insert_table  = 't_historico';  // Table name
	$insert_fields = array(   // Field list, add as many as needed
		 'C_Cliente' => "'{dataset[0][0]}'",
		 'C_CodValvula' => "'{dataset[0][1]}'",
		'C_CodOrden' => "'{dataset[0][2]}'"
	 );

	// Insert record
	$insert_sql = 'INSERT INTO ' . $insert_table
		. ' ('   . implode(', ', array_keys($insert_fields))   . ')'
		. ' VALUES ('    . implode(', ', array_values($insert_fields)) . ')';

	sc_exec_sql($insert_sql);
}

The problem its only if i do copy/paste on the field
Thx for the help

form_01.png

form_02.png

form_03.png