Obewariebip
New Member
My function in JavaScript/JQuery doesn't return anything; I want it to return the result for me but it won't. As you can see, the return is the \[code\]$("#resultado").html("O Valor do produto ficara "+resultado);\[/code\] but this doesn't appear as it should when the function is run:\[code\]<script src="http://stackoverflow.com//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script><script type="text/javascript"> $("#target").submit(function(){ var preco_dolar = $("#preco_dolar").val(); var dolar = $("#dolar").val(); var frete = $("#frete").val(); if ($('#drop').is(':checked')) { var drop = 5.8; }else var drop = 0; if(typeof preco_dolar == "undefined"){ alert("Erro ! Falta preco do produto"); } if(typeof frete == "undefined"){ var frete = 40; } if(typeof dolar == "undefined"){ var dolar = 2.16; } var resultado = (preco_dolar*dolar)+frete; $("#resultado").html("O Valor do produto ficara "+resultado);});</script>\[/code\]Can someone point out where I'm going wrong please?