convertisseur-degres.php

<html>
<head>
<title>Convertir Fahrenheit - degrés</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">
function displayTemp(){
if (document.forms[0].elements[1].checked){
var tempVal = document.forms[0].yourInput.value
var finalC = (tempVal-32)*5/9
var finalTemp = Math.round(finalC) + " degrés Celcius"
}
if (document.forms[0].elements[2].checked){
var tempVal = document.forms[0].yourInput.value
var finalF = (tempVal*9/5)+32
var finalTemp = Math.round(finalF) + " degrés Fahrenheit"
}
document.forms[1].result.value = finalTemp;
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<FORM>
<INPUT TYPE="text" name="yourInput" size=8 value="" onChange="displayTemp();">
<INPUT TYPE="radio" Name="F" Size=1 onclick="displayTemp();">Fahrenheit
<INPUT TYPE="radio" Name="F" Size=1 onclick="displayTemp();">Celsius
</FORM>
<P>
<FORM name=buttons>
<Br>
<Br>
Correspond à:<P>
<INPUT TYPE="text" Name="result" Size=30 Value="">
</FORM>
</body>
</html>
 
info/convertisseur-degres.txt · Dernière modification: 2008/11/11 11:37 (modification externe)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki