Telefonino.net network
 
| HOMEPAGE | INDICE FORUM | REGOLAMENTO | ::. NEI PREFERITI .:: | RSS Forum | RSS News | NEWS web | NEWS software |
| PUBBLICITA' | | ARTICOLI | WIN XP | VISTA | WIN 7 | REGISTRI | SOFTWARE | MANUALI | RECENSIONI | LINUX | HUMOR | HARDWARE | DOWNLOAD | | CERCA nel FORUM » |

Torna indietro   WinTricks Forum > Software > Programmazione

Notices

Rispondi
 
Strumenti discussione
Vecchio 09-04-2009, 13.09.17   #1
Billy_B
Guest
 
Messaggi: n/a
javascript mail-form

Ho scaricato del codice javascript da un sito per adattarlo alla mail-form del mio sito ma l'ho caricata sul server e non funziona. Il codice è quello che segue ed è nella sezione <head></head> della pagina:

function Email()
{
var dest_email = document.modulo.dest_email.value;
var mitt_email = document.modulo.mitt_email.value;
var mitt_tel = document.modulo.mitt_tel.value;
var mitt_nome = document.modulo.mitt_nome.value;
var oggetto = document.modulo.obj.value;
var messaggio = document.modulo.msg.value;

if ((mitt_nome == "") || (mitt_nome == "undefined"))
{
alert("Inserire nome.");
document.modulo.mitt_nome.focus();
}

else if
((mitt_email.indexOf("@") == (-1)) || (mitt_email == "") || (mitt_email == "undefined"))
{
alert("Inserire un indirizzo email valido.");
document.modulo.mitt_email.focus();
}

else if ((mitt_tel == "") || (mitt_tel == "undefined"))
{
alert("Inserire numero di telefono.");
document.modulo.mitt_tel.focus();
}

else if ((obj == "") || (obj == "undefined"))
{
alert("Inserire un oggetto.");
document.modulo.obj.focus();
}
else if ((messaggio == "") || (messaggio == "undefined"))
{
alert("Inserire un messaggio.");
document.modulo.msg.focus();
}

else
{
location.href = "mailto:" + dest_email + "?Subject=" + obj +
"&Body=messaggio: " + msg + " [ mittente: " + mitt_nome + " , " +
mitt_email + " , tel:" + mitt_tel + " ]";
}
}

__________________________________________________ _______________
Mentre la form è questa:

<form name="modulo">
<input type="hidden" name="dest_email" value="fake@mail.it">
<table height="335" width="589" style="font-size:12px; font-weight:bold" id="table1">
<tr>
<td valign="top" width="137" align="right">Nome:</td>
<td width="442"><input type="text" name="mitt_nome" size="29"></td>
</tr>
<tr>
<td valign="top" width="137" align="right">e-Mail:</td>
<td width="442"><input type="text" name="mitt_email" size="29"></td>
</tr>
<tr>
<td valign="top" width="137" align="right">Telefono:</td>
<td width="442"><input type="text" name="mitt_tel" size="29"></td>
</tr>
<tr>
<td valign="top" width="137" align="right">Oggetto:</td>
<td width="442"><input type="text" name="obj" size="29"></td>
</tr>
<tr>
<td valign="top" width="137" align="right">Messaggio:</td>
<td valign="top" width="442">
<textarea name="msg" rows="11" cols="52"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center" height="28">
<input type="reset" value=" Reset ">&nbsp;
<input type="submit" value=" Send " onclick="Email()">
</td>
</tr>
</table>
</form>

Qualcuno saprebbe dirmi, per favore, cosa c'é che non va? Grazie.

Ciao.
  Rispondi citando
Vecchio 09-04-2009, 14.29.52   #2
Alhazred
Made in Japan
Top Poster
 
L'avatar di Alhazred
 
Registrato: 04-07-2001
Messaggi: 4.461
Alhazred promette bene
location.href = "mailto:" + dest_email + "?Subject=" + obj +
"&Body=messaggio: " + msg + " [ mittente: " + mitt_nome + " , " +
mitt_email + " , tel:" + mitt_tel + " ]";

così ad occhio direi che il codice javascript obj ed msg non si sa chi sono.
Alhazred non è collegato   Rispondi citando
Rispondi


Utenti attualmente attivi che stanno leggendo questa discussione: 1 (0 utenti e 1 ospiti)
 
Strumenti discussione

Regole di scrittura
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is ON
Gli smilies sono ON
[IMG] è ON
Il codice HTML è OFF

Vai al forum

Discussioni simili
Discussione Autore discussione Forum Risposte Ultimo messaggio
[JSP] Usare form da una JSP inclusa... si può fare? Alhazred Programmazione 8 29-07-2008 11.31.48
javascript: inviare un form con pulsante testuale in frame gepngepin Programmazione 0 11-01-2008 12.50.55
Form Send Mail Giuseppe73 Programmazione 1 20-12-2005 13.22.15
Form per inviare mail con script Puffas Programmazione 5 07-09-2003 01.39.26

Orario GMT +2. Ora sono le: 00.42.30.


E' vietata la riproduzione, anche solo in parte, di contenuti e grafica.
Copyright © 1999-2017 Edizioni Master S.p.A. p.iva: 02105820787 • Tutti i diritti sono riservati
L'editore NON si assume nessuna responsabilità dei contenuti pubblicati sul forum in quanto redatti direttamente dagli utenti.
Questi ultimi sono responsabili dei contenuti da loro riportati nelle discussioni del forum
Powered by vBulletin - 2010 Copyright © Jelsoft Enterprises Limited.