Simple javascript osCommerce modification

I have a javascript that I made that automatically calculates cost and price of a product based on a value I input in 1 of the input boxes.

This is the code:

<script language="JavaScript">


function round(n) {

return [url removed, login to view](n*100+((n*1000)%10>4?1:0))/100;


function nextNearest(value, number) {

var ceil = [url removed, login to view](value);

var remainder = value % number;

if (remainder > 0)

value = value - remainder + number;

return value;


function CalculateTotals(){

f=[url removed, login to view];

f.cost.value=round([url removed, login to view]);

f.price.value=(nextNearest(([url removed, login to view]*3),0.5)[url removed, login to view]);

if ((nextNearest(([url removed, login to view]),0.5)[url removed, login to view])>[url removed, login to view]) {

f.price.value=(nextNearest(([url removed, login to view]),0.5)[url removed, login to view]);






<form name="orderform" method="post" action="formprocessor">

<input type="hidden" value="5" name="sh" />

<table border="3"><tr>





<input name="weight" size="7" value="50";" />



<input name="cost" size="7" />



<input name="rmb" size="7" />



<input name="price" size="7" />





<br /><input type="submit" value="Calculate!" onclick="CalculateTotals()" />



<script language="JavaScript">



The problem is that I need to implement this functionality in an osCommerce PHP script which dynamically generates the input fields and names (ie. they constantly change) and this is beyond my skills, although it should not take an expert more than 20 minutes to accomplish, and that's what I expect.

Full ftp access to my dev site and osCommerce admin access will be given.

The Budget for this very simple project is $30 USD. Due to the simplicity of this project I won't consider more expensive bids.

Beceriler: Javascript, OSCommerce, PHP

Daha fazlasını gör: usd 231, round name, javascript dev, html 5 dev, expert body modification, cost problem, c# math remainder, border html 5, what is javascript, what is a javascript, javascript what is, t sh, simple language, simple javascript, sh, input method, body expert, javascript html modification, post form hidden, need access 2010 expert, simple function, oscommerce product price, html javascript code simple, html post table, php post value

İşveren Hakkında:
( 12 değerlendirme ) Bangkok, Thailand

Proje NO: #705670



Hi, sir, can help you for this. thanks, kimi.

1 gün içinde %selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% USD
(144 Değerlendirme)

4 freelancers are bidding on average $30 for this job


I can do it fast..Lets start..

in %bids___i_period_sub_35% gün içinde30%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(19 Değerlendirme)

Please check PMB

in %bids___i_period_sub_35% gün içinde30%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(3 Değerlendirme)

hi, let's do it

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(1 Yorum)