henrick21 Posted November 25, 2006 Report Share Posted November 25, 2006 Fiz este codigo, mas não esta funcionando, alguém pode me dizer o porque?<form name=form><input name=i1 onclick="document.form.soma.value+=this.value" value='10' type=radio> 10<br><input name=i1 onclick="document.form.soma.value+=this.value" value='20' type=radio> 20<br><hr><input name=t1 onclick="document.form.soma.value+=this.value" value='1' type=radio> 1<br><input name=t1 onclick="document.form.soma.value+=this.value" value='2' type=radio> 2<br><hr><input name=v1 onclick="document.form.soma.value+=this.value" value='100' type=radio> 100<br><input name=v1 onclick="document.form.soma.value+=this.value" value='200' type=radio> 200<br><br><font size=1 face=verdana>Sub-Total: </font><input type=text name=soma></form> Quote Link to comment Share on other sites More sharing options...
0 rodrigo_pnunes Posted November 26, 2006 Report Share Posted November 26, 2006 henrick21 , e ai cara , estou querendo a mesma coisa que você , dá uma olhada no meu tópico , se alguém te responder por favor me repasse , farei o mesmo com você , abraço... Quote Link to comment Share on other sites More sharing options...
0 flavio Posted November 27, 2006 Report Share Posted November 27, 2006 Olha, você tá passando os valores como string ao invés de inteiro. Tente usar a função eval() Quote Link to comment Share on other sites More sharing options...
0 henrick21 Posted November 28, 2006 Author Report Share Posted November 28, 2006 exatamente rodrigo, eu postei este tópico pois queria ajudar voce mas não consegui e pedi a opniao dos aliados, mas acho que é quase isto.adicione estas linhas e veja que não muda nada, já tentei.se vocë estiver querendo dizer isto:<input name=v1 onclick="document.form.soma.value+=eval(this.value+3)" value='200' type=radio> 100<input name=v1 onclick="document.form.soma.value+=eval(document.form.v1[0].value+this.value)" value='200' type=radio> 200 Quote Link to comment Share on other sites More sharing options...
Question
henrick21
Fiz este codigo, mas não esta funcionando, alguém pode me dizer o porque?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.