hi my requirement is im having a datalist in which im having a textbox to display the number of items the user can type as many items he needs and then im having two labels one is to display the price of those items and the other is the total price of all the items.now wen i change the number of items the price and also the total price shud change when i press the tab.so for the above requiremnet i ve written a javascipt function lik this.
function ItemsHandler(tx tSourceid,lblSo urceid)
{
var str=3;
var totalPrice=docu ment.getElement ById('ctl00_Mai n_dtlstPrints_c tl05_lblTotValu e');
var data=document.g etElementById(' <%= this.dtlstPrint s.ClientID %>');
var totalImages=dat a.getElementsBy TagName("img");
for(i=0;i<=tota lImages.length; i++)
{
document.getEle mentById('ctl00 _Main_dtlstPrin ts_ctl0' + i + '_' + lblSourceid).in nerText = str * parseFloat(docu ment.getElement ById('ctl00$Mai n$dtlstPrints$c tl0' + i + '$'+txtSourceid ).value);
totalPrice.inne rText=parseFloa t(totalPrice.in nerText)+parseF loat(document.g etElementById(' ctl00_Main_dtls tPrints_ctl0' + i + '_' + lblSourceid).in nerText);
}
}
here im hard coding the price of the item but i need to get the price of the item from the database so can anybody help me regarding how to get the price of a item from database?
function ItemsHandler(tx tSourceid,lblSo urceid)
{
var str=3;
var totalPrice=docu ment.getElement ById('ctl00_Mai n_dtlstPrints_c tl05_lblTotValu e');
var data=document.g etElementById(' <%= this.dtlstPrint s.ClientID %>');
var totalImages=dat a.getElementsBy TagName("img");
for(i=0;i<=tota lImages.length; i++)
{
document.getEle mentById('ctl00 _Main_dtlstPrin ts_ctl0' + i + '_' + lblSourceid).in nerText = str * parseFloat(docu ment.getElement ById('ctl00$Mai n$dtlstPrints$c tl0' + i + '$'+txtSourceid ).value);
totalPrice.inne rText=parseFloa t(totalPrice.in nerText)+parseF loat(document.g etElementById(' ctl00_Main_dtls tPrints_ctl0' + i + '_' + lblSourceid).in nerText);
}
}
here im hard coding the price of the item but i need to get the price of the item from the database so can anybody help me regarding how to get the price of a item from database?
Comment