[Javascript] String -> Number impossible
Marcelo Wolfgang
grillo at gmail.com
Tue Aug 22 06:16:42 CDT 2006
Hi Diego,
I've done that, and that second tip helped me I've added this:
total = (rdVal*1)+(total*1);
and it is working
I'm now having a new problem, but this time with the getCheckedValue
function, only returning the correct value to the first field of the
<radio> input, the other 3 are returning 0.
:/
Thanks for the help
Marcelo
On 8/22/06, diego nunes <dnunes at gmail.com> wrote:
> On 8/22/06, Marcelo Wolfgang <grillo at gmail.com> wrote:
> > array_prices = new Array();
> > array_prices[1] = '115'; //these values are coming from a db
> > array_prices[2] = '95';
>
> Can you chance the server side script? Try using...
> array_prices=['poin',
> 115,
> 95
> ];
>
> And, even if it doens't work, you can use "+var" notation to
> convert it to number. Try something like this:
>
> > total = +total +(+array_prices[i]) *(2);]
> >
> > (...)
> >
> > rdVal = +getCheckedValue(document.frm_calcShipping.valFrete);
> > if (rdVal != 0) { total = total+rdVal; }
>
>
> Amplexos.
>
>
> --
> diego nunes
> dnunes.com
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
More information about the Javascript
mailing list