Skip to content

Instantly share code, notes, and snippets.

@alelazcano
Created August 18, 2026 21:15
Show Gist options
  • Select an option

  • Save alelazcano/4517764863ab40dccf1a331311244580 to your computer and use it in GitHub Desktop.

Select an option

Save alelazcano/4517764863ab40dccf1a331311244580 to your computer and use it in GitHub Desktop.
copiar-nombre-en-pagina-de-gracias.html
<script>
document.addEventListener("DOMContentLoaded", function () {
const params = new URLSearchParams(window.location.search);
const nombre = params.get("c_name") || "";
const transaction = params.get("transaction") || "";
function fillForm() {
const saludo = document.querySelector("#text-8683d492");
const campoTransaction = document.querySelector('[name="last_transaction_id"]');
if (saludo) {
saludo.textContent = nombre ? "Hola " + nombre : "Hola";
console.log("[Hotmart Debug] Saludo actualizado:", saludo.textContent);
}
if (campoTransaction) {
campoTransaction.readOnly = true;
campoTransaction.value = transaction;
console.log("[Hotmart Debug] Transaction ID actualizado:", campoTransaction.value);
}
}
fillForm();
/* redundancia - volvemos a intentar completar los campos */
setTimeout(function () {
fillForm();
}, 1000);
});
</script>
<style>
/* ocultamos el campo */
[name="last_transaction_id"] {display:none;}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment