Hi. Can someone show me how to correctly parse this form field name so that '.19' ends up being calculated as weight for shipping purposes?
The field is this:
Qty:<INPUT TYPE="TEXT" NAME="PROD-WAovalCap_.19-16.95" SIZE="3" MAXLENGTH="3" ONCHANGE="CalculateTotal(this.form)" VALUE="">
The script portion is here:
item_weight = parseFloat(form_name.substring(form_name.lastIndexOf("_") + 1))
-------------
item_weight should be .19 X item_quantity, but I'm either getting NaN as a result or '.5'
I am successfully parsing out '16.95' as the price, but cannot figure out how to get the '.19' out.
Hope that makes sense. I can publish the whole thing, but it was lengthy.
Thanks!
~ lahddah
The field is this:
Qty:<INPUT TYPE="TEXT" NAME="PROD-WAovalCap_.19-16.95" SIZE="3" MAXLENGTH="3" ONCHANGE="CalculateTotal(this.form)" VALUE="">
The script portion is here:
item_weight = parseFloat(form_name.substring(form_name.lastIndexOf("_") + 1))
-------------
item_weight should be .19 X item_quantity, but I'm either getting NaN as a result or '.5'
I am successfully parsing out '16.95' as the price, but cannot figure out how to get the '.19' out.
Hope that makes sense. I can publish the whole thing, but it was lengthy.
Thanks!
~ lahddah