Advertisement
LOVEGUN

Application Calcul Facture

Jan 12th, 2021
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Application Calcul</title>
  6.  
  7. <script language="javascript">
  8. function majus()
  9. {
  10.     var chaine=f.T1.value;
  11.      r=chaine.toUpperCase();
  12.     f.T1.value=r;
  13. }
  14. function comptage()
  15. {
  16.     var chaine=f.T1.value;
  17.     long= chaine.length;
  18.     f.T2.value=long;
  19. }
  20. function verif ()
  21. {
  22.     nom=f.T1.value;
  23.     menu=f.M1.options.selectedIndex;
  24.     q=f.T3.value;
  25.     if (menu==0)
  26.     {
  27.         alert ('Veuillez selectionner un produit');
  28.         return false;
  29.     }
  30.     if (nom=='')
  31.     {
  32.         alert ('Le champs "Nom & prénom du client" est vide');
  33.         return false;
  34.     }
  35.     if (q<2 || q>20)
  36.     {
  37.         alert ('Veuillez entrer une quantité valide');
  38.         return false;
  39.     }
  40.    
  41. }
  42. function calcul ()
  43. {
  44.     menu=f.M1.options.selectedIndex;
  45.     q=f.T3.value;
  46.     if (menu==0)
  47.     {
  48.         f.T4.value='No product selected';
  49.     }
  50.     if (menu==1)
  51.     {
  52.         m=f.M1.options[1].value*q;
  53.         c=String(m);
  54.         f.T4.value=c+' DT';
  55.     }
  56.     if (menu==2)
  57.     {
  58.         m=f.M1.options[2].value*q;
  59.         c=String(m);
  60.         f.T4.value=c+' DT';
  61.     }
  62.     if (menu==3)
  63.     {
  64.         m=f.M1.options[3].value*q;
  65.         c=String(m);
  66.         f.T4.value=c+' DT';
  67.     }
  68.  
  69. }
  70.  
  71. </script>
  72. </head>
  73. <body background="../../../Users/gamer/OneDrive/Documents/Test/sjaSMKm.png">
  74. <form id="f" name="form1" method="post" action="" >
  75.   <label>Nom &amp; prénom du client:
  76.   <input name="T1" type="text" id="T1" onblur="comptage()" />
  77.   </label>
  78.   <label>
  79.   <input type="button" name="Button" value="Majuscule" onclick="majus();" />
  80.   </label>
  81.   <label>Nombre de caractères tapés:
  82.   <input name="T2" type="text" id="T2" size="6" />
  83.   </label>
  84.   <hr>
  85.   <p>
  86.     Produit:
  87.     <select name="M1" id="M1" onchange="MM_jumpMenu('parent',this,0)">
  88.       <option>Choisissez un Produit</option>
  89.       <option value="12.500">Souris</option>
  90.       <option value="121.000">Scanner</option>
  91.       <option value="300.000">Imprimante</option>
  92.                 </select>
  93.   </p>
  94.   <p>Quantit&eacute;:
  95.     <label>
  96.     <input name="T3" type="text" id="T3" size="7" />
  97.     </label>
  98.   </p>
  99.   <p>
  100.     <label>
  101.     <input type="submit" name="Submit" value="Confirmer" onclick="return verif()" />
  102.     </label>
  103.     <label>
  104.     <input type="button" name="Submit2" value="Calculer" onclick="calcul()" />
  105.     </label>
  106.   </p>
  107.   <p>Montant de la Facture:
  108.     <label>
  109.     <input name="T4" type="text" id="T4" />
  110.     </label>
  111.   </p>
  112. </form>
  113. </body>
  114. </html>
  115.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement