Newsgroup: it.comp.lang.javascript
Titolo: x ati power prob risolto

Ci sono riuscito , era qualche campo nascosto che era incasinato.......
ecco lo script finale...  :
<html>
 <head>
  <meta http-equiv="content-type"
content="text/html;charset=iso-8859-1">
  <meta name="generator" content="Adobe GoLive 4">
  <title></title>
  <base target="_self">
  <script language="JavaScript1.2"><!--
function verOrder() {
 err = 0
 for(i = 1; i <= 8; i++) {
  val = testTxt(document.orderForm.elements[i].value)
  if(!val) { err += 1 }
  else {}
 }
 if(err!=0) {
  alert("Tutti i campi inerenti\nai dati dell'acquirente\ndevono essere
compilati.")
 }
 else {
  ntel = testNumTel(document.orderForm.Telefono.value)
  if(ntel) {
   email = testEmail(document.orderForm.EMail.value)
   if(email) { subOrder() }
   else { alert("Inserire un indirizzo\nemail valido.") }
  }
  else { alert("Inserire un numero\ndi telefono valido.") }
 }
}
function testTxt(txt) {
 if(txt == "" || txt.length < 2) { return false }
 else { return true }
}
function testEmail(email) {
 if((email.indexOf("@") == -1) |
  (email.indexOf(".") == -1) |
  (email.length < 7)) {
   return false
 }
 else {
  return true
 }
}
function testNumTel(num) {
 if(num.length>13) { return false }
 else {
  err=0
  abc="abcdefghijklmnopqrstuvwxyz"
  for(a=0;a<25;a++) {
   for(b=0;b<8;b++) {
    if(abc.charAt(a)==num.charAt(b)) {
     err++
    }
   }
  }
  if(num.charAt(1)=="0" | num.charAt(0)!="0") {
   err++
  }
  if(err!=0) {
   return false
  }
  else if(err==0) {
   return true
  }
 }
}
function subOrder() {
alert("L'ordine verr? inviato via email\ndal vostro programma di
posta.\nGrazie per l'acquisto.")
 setTimeout('top.location.href="index.htm"', 1000)
}
// -->
  </script>
 </head>
 <body text="#003300" link="#003300" vlink="#003300" alink="#003300"
bgcolor="#f0c8c8">
  <br>
  <center>
   <p>ESEMPIO, DI HTML PER IL SUO FORMULARIO :  Please Enter Your
Name:<br>
   <form method="POST" action="/cgi-bin/
formmail.pl
" name="orderForm">
    <input type="hidden" name="Data_Ordine"><input type="hidden"
name="recipient" value="
in...@decameronet.com
"><input type="hidden"
name="subject" value="Order Request">
   <table border="2" width="90%" bordercolor="#003300" cellspacing="0"
cellpadding="6" bgcolor="#ffffcc" height="1065">
    <tr height="54">
     <td height="54" valign="middle" align="center" colspan="2">
      <div align="right">
       <font face="Arial" color="#cc0000" size="4"><b>Dati
dell'acquirente&nbsp;&nbsp;</b></font></div>
     </td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial" size="3">Nome</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial" size="3"><input type="text" name="Nome"
size="20"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial" size="3">Cognome</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial" size="3"><input type="text" name="Cognome"
size="20"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial">Indirizzo </font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="Indirizzo"
size="30"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3">Citt&agrave;</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="Citta"
size="30"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3">Provincia</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="Provincia"
size="3"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3">CAP</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="CAP"
size="6"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3">Telefono</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="Telefono"
size="12"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3">E-mail</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="EMail"
size="20"></font></td>
    </tr>
    <tr height="46">
     <td height="46" valign="middle" align="left" colspan="2">
      <div align="right">
       <font face="Arial" color="#cc0000" size="4"><b>Dati per la
spedizione&nbsp;&nbsp;</b> </font><font face="Arial" color="#cc0000"
size="3"><br>
       </font><font face="Arial" color="#cc0000" size="2">(solo se
diversi da quelli dell'acquirente)&nbsp;&nbsp;&nbsp;</font></div>
     </td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial" size="3">Nome</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial" size="3"><input type="text"
name="Nome_Spedizione" size="20"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial" size="3">Cognome</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial" size="3"><input type="text"
name="Cognome_Spedizione" size="20"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
color="#003300" face="Arial">Indirizzo </font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="Indirizzo_Spedizione"
size="30"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3">Citt&agrave;</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="Citta_Spedizione"
size="30"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3">Provincia</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="Provincia_Spedizione"
size="3"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3">CAP</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="CAP_Spedizione"
size="6"></font></td>
    </tr>
    <tr height="26">
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3">Telefono</font></td>
     <td width="50%" height="26" valign="middle" align="left"><font
face="Arial" size="3"><input type="text" name="Telefono_Spedizione"
size="12"></font></td>
    </tr>
    <tr height="52">
     <td height="52" valign="middle" align="left" colspan="2">
      <div align="right">
       <font color="#cc0000" face="Arial" size="4"><b>Note e
suggerimenti&nbsp;&nbsp;</b></font></div>
     </td>
    </tr>
    <tr height="79">
     <td width="50%" height="79" valign="middle" align="left"><font
face="Arial" size="3">Note</font></td>
     <td width="50%" height="79" valign="middle" align="left"><textarea
rows="3" name="Note" cols="25"></textarea></td>
    </tr>
    <tr height="49">
     <td height="49" valign="middle" align="left" colspan="2">
      <div align="right">
       <font color="#cc0000" face="Arial" size="4"><b>Ordine
completato&nbsp;&nbsp;</b></font></div>
     </td>
    </tr>
    <tr height="26">
     <td height="26" valign="middle" align="left" colspan="2">
      <div align="right">
       <font face="Arial" size="3">Azzera tutti i campi del
formulario</font> &nbsp;<input type="reset" value="Azzera"
name="B3">&nbsp;&nbsp;</div>
     </td>
    </tr>
    <tr height="61">
     <td height="61" valign="middle" align="left" colspan="2">
      <center>
       <a
href="../decameron%20in%20progres/shopping%20cart%20/cart/index2.htm"
target="_top"><font color="#003300" face="Arial" size="4"><img
border="0"
src="../decameron%20in%20progres/shopping%20cart%20/cart/back.gif"
align="absmiddle" width="32" height="27"> Annulla
l'ordine</font></a><font color="#003300" face="Arial"
size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a
href="javascript:verOrder()">Invia l'ordine <img border="0"
src="../decameron%20in%20progres/shopping%20cart%20/cart/vai.gif"
align="absmiddle" width="32" height="27"></a></font><input type="submit"
value="Invia" name="B4" onmouseup="subOrder()"></center>
     </td>
    </tr>
   </table>
   <input type="hidden" name="p1_quantita"> <input type="hidden"
name="p1_codice"> <input type="hidden" name="p2_quantita"> <input
type="hidden" name="p2_codice"> <input type="hidden" name="p3_quantita">
<input type="hidden" name="p3_codice"> <input type="hidden"
name="p4_quantita"> <input type="hidden" name="p4_codice">
   </form>
   </p>
   <p>&nbsp;</center>
 </body>
 <script language="JavaScript">
 alert("I dati inseriti nel formulario\nverranno inviati all'indirizzo\
mag...@dataport.it
 con lo\nscopo di dimostrare l'uso\ndel programma. Si
prega di\ninserire solo dati fittizi. Grazie.")
 oggi=new Date()
 gg=oggi.getDate()
 mm=oggi.getMonth()+1
 aa=oggi.getYear()
 d="/"
 dataOggi=gg+d+mm+d+aa
 parent.framedx.vista = "lock"
 if(parent.framedx.qtaTotale!=0) {
  document.orderForm.p1_quantita.value = parent.framedx.p1_qta
  document.orderForm.p1_codice.value = parent.framedx.p1_cod
  document.orderForm.p2_quantita.value = parent.framedx.p2_qta
  document.orderForm.p2_codice.value = parent.framedx.p2_cod
  document.orderForm.p3_quantita.value = parent.framedx.p3_qta
  document.orderForm.p3_codice.value = parent.framedx.p3_cod
  document.orderForm.p4_quantita.value = parent.framedx.p4_qta
  document.orderForm.p4_codice.value = parent.framedx.p4_cod
  document.orderForm.Data_Ordine.value = dataOggi
 }
 else {}
</script>
</html>
<noscript>
ciao e grazie....

