I have a script like this, for shipping options
<script language="javascript">
$(document).ready(function()
{
var total = 0;
function calcTotal()
{
$("input:checked").each(function()
{
//This happens for each checked input field
var value = $(this).attr("value");
total += parseInt(value);
});
}
//This happens when the page loads
calcTotal();
$("#total").append('<input style="border:0px" type="text" name="total" value=" '+ total +' " readonly />');
$("input:radio").click(function()
{
total = 0;
calcTotal();
$("#total").html ('<input style="border:0px" type="text" name="total" value=" '+ total +' " readonly />');
});
});
</script>
using the radio inputs to the option results in total
option 1 <input name="shipp" type="radio" value="1234567" checked />
option 2 <input name="shipp" type="radio" value="2345678" />
output: <div id=total></div>
I need help, how to make the view the total number of formats for thousands?, for example 1234567, the result will be 1,234,567 ?
thanks for help