controling a float value with javascript
<p>to control my input type and verify that its value is pretty a float in my form i deal with it in javascript like that:</p>

<pre><code>function verifierNombre () {
var champ=document.getElementById("nperformed");
var str = champ.value;
if(str.value==' '){champ.focus();}
if (isNaN(str)) {
alert("Invalid Valid! the field must be a number");
champ.focus();
return false;
}
return true;

}
</code></pre>

<p>but it still false because it doesn't accept really floats.
so when entering a value like '11,2' the alert is declenched.</p>

<p>I want to know how can I control float values with javascript.
thanks.</p>
