ciao.
Ho scritto questo codice che mi funziona correttamente solo su IE mentre su firefox mi passa dei valori un po' strani...
questa è la pagina 1
codice:
<form name="form1" method="post" action="inserimento_fatture_2.php">
...
<tr bgcolor="#CCCCCC">
<td colspan="5"><span class="style2">Nome azienda
<? //tiro fuori la lista delle anagrafiche esistenti
$tutto = "SELECT * FROM gestionale_anagrafiche";
$query = mysql_query ($tutto,$db)
or die ("Non riesco ad eseguire la richiesta $tutto".mysql_error());
echo "<select name=\"nome_azienda\">
<option>Seleziona</option>";
while ($valori = mysql_fetch_array ($query))
{
$nome = $valori ['nome_azienda'];
echo "<option value=\"$nome\">$nome</option>";
}
echo "$nome";
echo "</select>";
?>
</span><span class="style2">
</span></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="15%" height="45"><span class="style2">Codice IVA
<select name="cod_iva1">
<option>Seleziona</option>
<option value="1">nessuna</option>
<option value="1.1">10%</option>
<option value="1.2">20%</option>
</select>
</span></td>
<td width="18%"><span class="style2">Imponibile
<input name="imponibile_int1" type="text" id="imponibile_int1" size="6">
,
<input name="imponibile_dec1" type="text" id="imponibile_dec1" value="00" size="2">
</span></td>
<td width="18%"><span class="style2">IVA
<input type="text" name="iva" disabled>
</span></td>
<td width="19%"><span class="style2">Subtotale
<input type="text" name="tot" disabled>
</span></td>
<td></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="15%" height="45"><span class="style2">Codice IVA
<select name="cod_iva2">
<option>Seleziona</option>
<option value="1">nessuna</option>
<option value="1.1">10%</option>
<option value="1.2">20%</option>
</select>
</span></td>
<td width="18%"><span class="style2">Imponibile
<input name="imponibile_int2" type="text" id="imponibile_int2" size="6">
,
<input name="imponibile_dec2" type="text" id="imponibile_dec2" value="00" size="2">
</span></td>
<td width="18%"><span class="style2">IVA
<input type="text" name="iva" disabled>
</span></td>
<td><span class="style2">Subtotale
<input type="text" name="tot" disabled>
</span></td>
<td></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="15%" height="45"><span class="style2">Codice IVA
<select name="cod_iva3">
<option>Seleziona</option>
<option value="1">nessuna</option>
<option value="1.1">10%</option>
<option value="1.2">20%</option>
</select>
</span></td>
<td width="18%"><span class="style2">Imponibile
<input name="imponibile_int3" type="text" id="imponibile_int3" size="6">
,
<input name="imponibile_dec3" type="text" id="imponibile_dec3" value="00" size="2">
</span></td>
<td width="18%"><span class="style2">IVA
<input type="text" name="iva" disabled>
</span></td>
<td><span class="style2">Subtotale
<input type="text" name="tot" disabled>
</span></td>
<td></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="5"><span class="style2">Causale
<textarea name="causale" cols="100"></textarea>
</span></td>
</tr>
<tr>
<td colspan="5"><input type="submit" name="Submit" value="Inserisci"></td>
</tr>
...
e questa è la 2...
codice:
<?
include ("menu.php");
$imponibile1 = "$imponibile_int1.$imponibile_dec1";
$imponibile2 = "$imponibile_int2.$imponibile_dec2";
$imponibile3 = "$imponibile_int3.$imponibile_dec3";
?>
...
<tr bgcolor="#CCCCCC">
<td colspan="4"><span class="style2">Codice fattura
<select name="cod_fattura">
<option>Seleziona</option>
<option value="fattura_acquisto" <? if ($cod_fattura == 'fattura_acquisto') echo "selected"; ?>>Fattura Acquisto</option>
<option value="fattura_vendita" <? if ($cod_fattura == 'fattura_vendita') echo "selected"; ?>>Fattura Vendita</option>
<option value="nota_accredito" <? if ($cod_fattura == 'nota_accredito') echo "selected"; ?>>Nota D'accredito</option>
</select>
</span></td></tr>
<tr bgcolor="#CCCCCC">
<td colspan="5"><span class="style2">Nome azienda
<input type="text" name="nome_azienda" value="<? echo "$nome_azienda"; ?>">
</span><span class="style2"> </span><span class="style2"> </span></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="15%" height="45"><span class="style2">Codice IVA
<select name="cod_iva1">
<option>Seleziona</option>
<option value="1" <? if ($cod_iva1 == '1') echo "selected"; ?>>nessuna</option>
<option value="1.1" <? if ($cod_iva1 == '1.1') echo "selected"; ?>>10%</option>
<option value="1.2" <? if ($cod_iva1 == '1.2') echo "selected"; ?>>20%</option>
</select>
</span></td>
<td width="18%"><span class="style2">Imponibile
<input name="imponibile_int" type="text" size="6" value="<? echo "$imponibile_int1"; ?>">
,
<input name="imponibile_dec" type="text" size="2" value="<? echo "$imponibile_dec1"; ?>">
</span></td>
<td width="18%"><span class="style2">IVA
<input name="iva" type="text" value="<? $iva1 = (($imponibile1 * $cod_iva1) - $imponibile1); echo "$iva1"; ?>" disabled>
</span></td>
<td width="19%"><span class="style2">Subtotale
<input name="tot" type="text" value="<? $subtot1 = ($imponibile1 + $iva1); echo "$subtot1"; ?>" disabled>
</span></td>
<td></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="15%" height="45"><span class="style2">Codice IVA
<select name="cod_iva2">
<option>Seleziona</option>
<option value="1" <? if ($cod_iva2 == '1') echo "selected"; ?>>nessuna</option>
<option value="1.1" <? if ($cod_iva2 == '1.1') echo "selected"; ?>>10%</option>
<option value="1.2" <? if ($cod_iva2 == '1.2') echo "selected"; ?>>20%</option>
</select>
</span></td>
<td width="18%"><span class="style2">Imponibile
<input name="imponibile_int" type="text" size="6" value="<? echo "$imponibile_int2"; ?>">
,
<input name="imponibile_dec" type="text" size="2" value="<? echo "$imponibile_dec2"; ?>">
</span></td>
<td width="18%"><span class="style2">IVA
<input name="iva" type="text" value="<? $iva2 = (($imponibile2 * $cod_iva2) - $imponibile2); echo "$iva2"; ?>" disabled>
</span></td>
<td><span class="style2">Subtotale
<input name="tot" type="text" value="<? $subtot2 = ($imponibile2 + $iva2); echo "$subtot2"; ?>" disabled>
</span></td>
<td></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="15%" height="45"><span class="style2">Codice IVA
<select name="cod_iva3">
<option>Seleziona</option>
<option value="1" <? if ($cod_iva3 == '1') echo "selected"; ?>>nessuna</option>
<option value="1.1" <? if ($cod_iva3 == '1.1') echo "selected"; ?>>10%</option>
<option value="1.2" <? if ($cod_iva3 == '1.2') echo "selected"; ?>>20%</option>
</select>
</span></td>
<td width="18%"><span class="style2">Imponibile
<input name="imponibile_int" type="text" size="6" value="<? echo "$imponibile_int3"; ?>">
,
<input name="imponibile_dec" type="text" size="2" value="<? echo "$imponibile_dec3"; ?>">
</span></td>
<td width="18%"><span class="style2">IVA
<input name="iva" type="text" value="<? $iva3 = (($imponibile3 * $cod_iva3) - $imponibile3); echo "$iva3"; ?>" disabled>
</span></td>
<td><span class="style2">Subtotale
<input name="tot" type="text" value="<? $subtot3 = ($imponibile3 + $iva3); echo "$subtot3"; ?>" disabled>
</span></td>
<td>TOTALE
<input name="totale" type="text" id="totale" value="<? $totale = $subtot1 + $subtot2 + $subtot3; echo "$totale"; ?>"></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="5"><span class="style2">Causale
<textarea name="causale" cols="100"><? echo "$causale"; ?> </textarea>
</span></td>
</tr>
<tr>
<td colspan="5"><input type="submit" name="Submit" value="Inserisci"></td>
</tr>
..
che ne dite?