rvggitschtal
Posts: 7
|
| Posted: 11/07/2007, 3:00 AM |
|
I have an editable grid, having product and unit price.
I've loaded my product/prices in an array "price".
Every time a new line is added, the unit price should be picked up from the array.
Product id --> key_d
Field to be pouplated --> unit_price
Array has product_id and unit_price
price = new Array (); price[2]='5.46'; price[3]='0.48'; price[4]='5.00'; price[5]='0.62'; price[6]='6.86';
In the OnChange event of key_d, I coded following statement:
var Element_Number = this.name.substring(6)-1;
var Element_ID = dms_itemsElements[Element_Number][dms_itemskey_dID].value;
if (parseInt(Element_ID) > 0 ) {
dms_itemsElements[Element_Number][dms_itemsunit_priceID].value = price[parseInt(Element_ID)];}
else {
dms_itemsElements[Element_Number][dms_itemsunit_priceID].value = price[parseInt(Element_ID)];}
Could someone help me on this ?
Thanks
|
 |
 |
|