Bonjour à vous deux,
Merci pour vos conseil. Le php est trop loin de ce que je connais, par contre j'ai pu modifier la calculatrice en java pour obtenir ce que je voulais.
Je connais pas le java non plus mais c'est plus logique, alors c'est un peu grossier mais ça donne:
<SCRIPT type=text/javascript>
<!--function verification(entree) { var seulement_ceci ="0123456789[]()-+*%/."; for (var i = 0; i < entree.length; i++) if (seulement_ceci.indexOf(entree.charAt(i))<0 ) return false; return true; } function resultat() { var x = 0; if (verification(window.document.calculatrice.affiche.value)) x = eval(window.document.calculatrice.affiche.value); window.document.calculatrice.affiche.value = x; } function ajouter(caracteres) { window.document.calculatrice.affiche.value = window.document.calculatrice.affiche.value + caracteres; } function fonction_speciale(fonction) { if (verification(window.document.calculatrice.affiche.value)) { if(fonction == "sqrt") { var x = 0; x = eval(window.document.calculatrice.affiche.value); window.document.calculatrice.affiche.value = Math.sqrt(x); } if(fonction == "pow") { var x = 0; x = eval(window.document.calculatrice.affiche.value); window.document.calculatrice.affiche.value = x * x; } if(fonction == "log") { var x = 0; x = eval(window.document.calculatrice.affiche.value); window.document.calculatrice.affiche.value = Math.log(x); } } else window.document.calculatrice.affiche.value = 0}//-->
</SCRIPT>
<STYLE type=text/css>
<!--.button { width:60px; text-align:center; font-family:System,sans-serif; font-size:100%; }.affiche { width:100%; text-align:right; font-family:System,sans-serif; font-size:100%; }-->
</STYLE>
<FORM onsubmit="resultat();return false;" name=calculatrice action="">
<TABLE border=5 cellSpacing=0 cellPadding=10>
<TBODY>
<TR>
<TD bgColor=#c0c0c0><INPUT class=affiche align=right name=Texte1><INPUT class=affiche align=right name=Texte2></TD></TR>
<TR>
<TD bgColor=#e0e0e0>
<TABLE border=0 cellSpacing=2 cellPadding=0>
<TBODY>
<TR>
<TD><INPUT class=affiche align=right name=Texte3></TD></TR><INPUT class=button onclick="window.document.calculatrice.Texte3.value = window.document.calculatrice.Texte1.value / window.document.calculatrice.Texte2.value" value=" IPM " width=60 type=button></TD>
<TR></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></FORM>
Et paf! ça marche.
Merci pour l'aide et bonne fin de soirée!
Alloueste