|
|
(No se muestran 18 ediciones intermedias de 2 usuarios) |
Línea 1: |
Línea 1: |
| function actualizarTextoLibre() {
| |
| var titulo = document.getElementById('campo-titulo').value;
| |
| var year = document.getElementById('campo-year').value;
| |
| var autor = document.getElementById('campo-autor').value;
| |
| var plataformas = document.getElementById('campo-plataformas').value;
| |
| var herramienta = document.getElementById('campo-herramienta').value;
| |
| var tipo = document.getElementById('campo-tipo').value;
| |
|
| |
|
| var texto = `'''${titulo}''' es una [[${tipo}]] realizada en ${year} por [[${autor}]] para [[${plataformas}]] empleando el [[${herramienta}]].`;
| |
|
| |
| document.getElementById('campo-texto-libre').value = texto;
| |
| }
| |
|
| |
| // Llama a la función cuando el formulario cambie
| |
| document.addEventListener('DOMContentLoaded', function() {
| |
| document.getElementById('campo-titulo').addEventListener('input', actualizarTextoLibre);
| |
| document.getElementById('campo-year').addEventListener('input', actualizarTextoLibre);
| |
| document.getElementById('campo-autor').addEventListener('input', actualizarTextoLibre);
| |
| document.getElementById('campo-plataformas').addEventListener('input', actualizarTextoLibre);
| |
| document.getElementById('campo-herramienta').addEventListener('input', actualizarTextoLibre);
| |
| document.getElementById('campo-tipo').addEventListener('input', actualizarTextoLibre);
| |
| });
| |