KEFRON |
|
- Group:
- Member
- Posts:
- 69
- reputazione:
- 0
- Location:
- ---
- Status:
| |
| come faccio ad inserire nel messaggio di testo un messaggio gią copiato in precedenza ? ho provato a fare cosi ma non funziona : CODICE <!DOCTYPE html>
<head> Tabelle per il gioco di ruolo <script type="text/javascript"> function inviaDati() { // Recupera i valori inseriti dal giocatore var professione = document.getElementById("professione").value; var nome = document.getElementById("nome").value; var eta = document.getElementById("eta").value; var attacchi = document.getElementById("attacchi").value; var magie = document.getElementById("magie").value; var oggettiZaino = document.getElementById("oggettiZaino").value;
// Crea una stringa con i dati del giocatore var datiGiocatore = "Professione: " + professione + "<br>" + "Nome: " + nome + "<br>" + "Etą: " + eta + "<br>" + "Attacchi: " + attacchi + "<br>" + "Magie: " + magie + "<br>" + "Oggetti nello zaino: " + oggettiZaino;
// Copia e incolla i dati nella pagina del forum document.getElementById("datiForum").innerHTML = datiGiocatore; } </script> </head> <body> <h1>Tabelle per il gioco di ruolo</h1>
<table> <tr> <td>Professione:</td> <td><input type="text" id="professione"></td> </tr> <tr> <td>Nome:</td> <td><input type="text" id="nome"></td> </tr> <tr> <td>Etą:</td> <td><input type="text" id="eta"></td> </tr> <tr> <td>Attacchi:</td> <td><input type="text" id="attacchi"></td> </tr> <tr> <td>Magie:</td> <td><input type="text" id="magie"></td> </tr> <tr> <td>Oggetti nello zaino:</td> <td><input type="text" id="oggettiZaino"></td> </tr> </table>
<form action="https://hfantasynovel.forumcommunity.net" method="post" > <input type="hidden" name="st" value="0"> <input type="hidden" name="act" value="Post"> <input type="hidden" name="f" value="9095351"> <input type="hidden" name="CODE" value="03"> <input type="hidden" name="t" value="62044699"> <input type="hidden" name="Post" value="<h2>Dati del giocatore nel forum:</h2> <div id="datiForum"></div> ">
<button onclick="inviaDati()" alt="Invia il modulo" >Invio</button>
</form>
|
| |