I want to develop an example simulator: from 1 to 99 real multiplies it by x10 and strong> real it multiplies by x11 .
I wanted to know how to convert the number of campo1
to real when typing?
Code:
<html>
<body>
<head>
</head>
<script>
function soma()
{
form.campo4.value = (form.campo1.value*1) * (form.campo2.value*1)
$('form.campo1').priceFormat({
prefix: 'R$ ',
centsSeparator: ',',
thousandsSeparator: '.'
});
}
</script>
<form name="form">
<p> Simulador de Cash's</p>
<input name="campo1" type="text" value="" class="soma"><br>
<input name="campo2" value="22" readonly><br>
<input name="campo4" readonly><br>
<input type="button" onclick="soma()" value="CALCULAR">
</form>
</body>
</html>