Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script type="text/javascript">
- function Email() {
- var nome = document.modulo.nome.value;
- var email = document.modulo.email.value;
- var oggetto = document.modulo.oggetto.value;
- var messaggio = document.modulo.messaggio.value;
- if ((nome == "") || (nome == "undefined")) {
- alert("Inserire un nome.");
- document.modulo.nome.focus();
- }
- else if ((email.indexOf("@") == (-1)) || (email == "") || (email == "undefined")) {
- alert("Inserire un indirizzo email valido.");
- document.modulo.email.focus();
- }
- else if ((oggetto == "") || (oggetto == "undefined")) {
- alert("Inserire un oggetto.");
- document.modulo.oggetto.focus();
- }
- else if ((messaggio == "") || (messaggio == "undefined")) {
- alert("Inserire un messaggio.");
- document.modulo.messaggio.focus();
- }
- else {
- location.href = "mailto:" + email + "?Subject=" + oggetto + "&Body=" + messaggio;
- }
- }
- </script>
- </head>
- <body>
- <form name="modulo">
- Nome:<br />
- <input type="text" name="nome"> <br />
- Email:<br />
- <input type="text" name="email"> <br />
- Oggetto:<br />
- <input type="text" name="oggetto"> <br />
- Messaggio:<br />
- <textarea name="messaggio" rows="10" cols="30"></textarea> <br/>
- <input type="button" value="Invia" onClick="Email()">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement