Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Application Calcul</title>
- <script language="javascript">
- function majus()
- {
- var chaine=f.T1.value;
- r=chaine.toUpperCase();
- f.T1.value=r;
- }
- function comptage()
- {
- var chaine=f.T1.value;
- long= chaine.length;
- f.T2.value=long;
- }
- function verif ()
- {
- nom=f.T1.value;
- menu=f.M1.options.selectedIndex;
- q=f.T3.value;
- if (menu==0)
- {
- alert ('Veuillez selectionner un produit');
- return false;
- }
- if (nom=='')
- {
- alert ('Le champs "Nom & prénom du client" est vide');
- return false;
- }
- if (q<2 || q>20)
- {
- alert ('Veuillez entrer une quantité valide');
- return false;
- }
- }
- function calcul ()
- {
- menu=f.M1.options.selectedIndex;
- q=f.T3.value;
- if (menu==0)
- {
- f.T4.value='No product selected';
- }
- if (menu==1)
- {
- m=f.M1.options[1].value*q;
- c=String(m);
- f.T4.value=c+' DT';
- }
- if (menu==2)
- {
- m=f.M1.options[2].value*q;
- c=String(m);
- f.T4.value=c+' DT';
- }
- if (menu==3)
- {
- m=f.M1.options[3].value*q;
- c=String(m);
- f.T4.value=c+' DT';
- }
- }
- </script>
- </head>
- <body background="../../../Users/gamer/OneDrive/Documents/Test/sjaSMKm.png">
- <form id="f" name="form1" method="post" action="" >
- <label>Nom & prénom du client:
- <input name="T1" type="text" id="T1" onblur="comptage()" />
- </label>
- <label>
- <input type="button" name="Button" value="Majuscule" onclick="majus();" />
- </label>
- <label>Nombre de caractères tapés:
- <input name="T2" type="text" id="T2" size="6" />
- </label>
- <hr>
- <p>
- Produit:
- <select name="M1" id="M1" onchange="MM_jumpMenu('parent',this,0)">
- <option>Choisissez un Produit</option>
- <option value="12.500">Souris</option>
- <option value="121.000">Scanner</option>
- <option value="300.000">Imprimante</option>
- </select>
- </p>
- <p>Quantité:
- <label>
- <input name="T3" type="text" id="T3" size="7" />
- </label>
- </p>
- <p>
- <label>
- <input type="submit" name="Submit" value="Confirmer" onclick="return verif()" />
- </label>
- <label>
- <input type="button" name="Submit2" value="Calculer" onclick="calcul()" />
- </label>
- </p>
- <p>Montant de la Facture:
- <label>
- <input name="T4" type="text" id="T4" />
- </label>
- </p>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement