Skip to toolbar

Community & Business Groups

HTML5 tag specs

Hi Guys !!!

My name is Elcio Abrahão and I m an University Teacher in São Paulo – Brazil.

I m using HTML5 to teach programing for my students the form did not change the output value when I add a field type “radio” to the “for” attribute. Is this a project specification or this is a bug ??

Important: I wish did not to use Javascript in other place except on the “oninput” attribute.

This is the test code:

<!DOCTYPE html>
<title>Regra de 3 Simples</title>
<h1>Cálculo Genérico de Regra de 3 Simples</h1><br/><br/>
<form name=”form1″ oninput=”if(document.form1.tipo1.checked==true){
x.value = parseFloat(v2.value)*parseFloat(v3.value)/parseFloat(v1.value)
x.value = parseFloat(v1.value)*parseFloat(v2.value)/parseFloat(v3.value)
<h2>Escolha tipo da regra de três simples</h2>
<input type=”radio” name=”tipo” id=”tipo1″ value=”1″>Diretamente Proporcional<br/><br/>
<input type=”radio” name=”tipo” id=”tipo2″ value=”2″>Inversamente Proporcional<br/><br/>
<table border=”1″>
<tr><th>Grandeza 1</th><th>Grandeza 2</th></tr>
<tr><td><input type=”number” id=”v1″ value=”0″ />
</td><td><input type=”number” id=”v2″ value=”0″ />
</td></tr><tr><td><input type=”number” id=”v3″ value=”0″ /></td>
<td><output name=”x” for=”v1 v2 v3 tipo”></output></tr>

I just tried to change the calculation when the user check other radio button. I tested on Firefox and Chrome but I must change some “number” type field to get the calculation changed…

Could you help me ?

Thanks  !!!

Best Regards,

Elcio Abrahão.

Leave a Reply

Your email address will not be published. Required fields are marked *


Before you comment here, note that this forum is moderated and your IP address is sent to Akismet, the plugin we use to mitigate spam comments.