1- how do i make my form desapers in my eclipse java Web project?
2-how do i get the number to display two digits after my decimal?
thx you
--- Update ---
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>formulaire</title>
</head>
<body>
<form>
Numéro facture : <input type='text' name='noFacture' /> <br>
Date : <input type='text' name='dateFacture' /> <br>
Nom client : <input type='text' name='nomClient' /> <br>
Adresse : <input type='text' name='adresse' /> <br>
Ville : <input type='text' name='ville' /> <br>
Province : <input type='text' name='province' /> <br>
Pays : <input type='text' name='pays' /> <br>
Code Postal : <input type='text' name='codePostal' /> <br>
Quantité : <input type='text' name='quantite' /> <br>
Produit : <input type='text' name='produit' /> <br>
Prix unitaire : <input type='text' name='prixUnitaire' /> <br>
<input type='submit' value='Produire facture' />
</form>
<hr>
<%!
//info des taxes
public static final double TPS = 0.05;
public static final double TVQ = 0.09975;
public static final String QUEBEC = "Québec";
public static final String CANADA = "Canada";
%>
<%
//obtenir les infos et calcul du prix
if (request == null || request.getParameter("noFacture") == null) {
return;
}
double prixUnitaire = Double.parseDouble(request.getParameter("prixUnita ire"));
String noFacture = request.getParameter("noFacture");
String dateFacture = request.getParameter("dateFacture");
String nomClient = request.getParameter("nomClient");
String adresse = request.getParameter("adresse");
String ville = request.getParameter("ville");
String province = request.getParameter("province");
String pays = request.getParameter("pays");
String codePostal = request.getParameter("codePostal");
double quantite = Double.parseDouble(request.getParameter("quantite" ));
String produit = request.getParameter("produit");
double prixAvantTaxes= Math.ceil(quantite * prixUnitaire);
double tps = 0;
double tvq = 0;
if (CANADA.equals(pays)) {
tps = Math.ceil(prixAvantTaxes * TPS);
if (QUEBEC.equals(province)) {
tvq = Math.ceil(prixAvantTaxes * TVQ);
}
}
double prixApresTaxes = prixAvantTaxes + tps + tvq;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="tp1.css">
<title>Facture</title>
</head>
<body>
<table>
<tr>
<td class='logo'><img height='40px' src='at.png' /><td>
<td class='adresse-co'>Technologies AT
<br>3000 Ch. Côte-Ste-Catherine
<br>Montréal (Québec) Canada
<br>H3T 3A7
</td>
<td class='no-facture'><% out.println(noFacture); %>
<br> <% out.println(dateFacture); %>
</td>
</tr>
</table>
<table>
<tr>
<th class='titre-adresse-cl'>FACTURÉ À€</th>
<th class='titre-adresse-cl'>LIVRÉ À€</th>
</tr>
<tr>
<td class='adresse-cl'> <% out.println(nomClient); %>
<br><% out.println(adresse); %>
<br><%//ville (provnce) pays
out.println(ville); %>
<% out.println("("+province+")"); %>
<% out.println(pays); %>
<br><% out.println(codePostal); %>
</td>
<td class='adresse-cl'><% out.println(nomClient); %>
<br><% out.println(adresse); %>
<br><%//ville (provnce) pays
out.println(ville); %>
<% out.println("("+province+")"); %>
<% out.println(pays); %>
<br><% out.println(codePostal); %>
</td>
</tr>
</table>
<table class='details'>
<tr class='gris'>
<th class='qte blanc'>Qté</th>
<th class='desc blanc'>Description</th>
<th class='prix blanc'>Prix Unit.</th>
<th class='total blanc'>Total</th>
</tr>
<tr class='gris'>
<td class='droite qte'><% out.print(quantite); %></td>
<td class='desc'><% out.println(produit); %></td>
<td class='droite prix'><% out.print(prixUnitaire); %></td>
<td class='droite total'><% out.print(prixAvantTaxes); %></td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr class='gris'>
<td class='droite qte'> </td>
<td class='desc'> </td>
<td class='droite prix'> </td>
<td class='droite total'> </td>
</tr>
<tr>
<td colspan='3' class='droite final'>Sous-Total</td><td class='droite total'><% out.print(prixAvantTaxes); %></td>
</tr>
<tr>
<td colspan='3' class='droite final'>TPS/TVH</td><td class='droite total'><% out.print(tps); %></td>
</tr>
<tr>
<td colspan='3' class='droite final'>TVP</td><td class='droite total'><% out.print(tvq); %></td>
</tr>
<tr>
<th colspan='3' class='droite final'>Total</th><th class='droite total'><% out.print(prixApresTaxes); %></th>
</tr>
</table>
<p>Payable 30 jours</p>
<p>
Numéro TPS/TVH : 12345678910
<br>Numéro TVP : 12345678910
</p>
</body>
</html>
<%// é = é || è = è %>
<hr>
<html> <head>
</body>
</head>
</body>
</html>