473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

javascript with database values?

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(txtSourceid,lblSourceid)
{
var str=3;
var totalPrice=document.getElementById('ctl00_Main_dtl stPrints_ctl05_lblTotValue');
var data=document.getElementById('<%= this.dtlstPrints.ClientID %>');
var totalImages=data.getElementsByTagName("img");
for(i=0;i<=totalImages.length;i++)
{
document.getElementById('ctl00_Main_dtlstPrints_ct l0' + i + '_' + lblSourceid).innerText = str * parseFloat(document.getElementById('ctl00$Main$dtl stPrints$ctl0' + i + '$'+txtSourceid).value);
totalPrice.innerText=parseFloat(totalPrice.innerTe xt)+parseFloat(document.getElementById('ctl00_Main _dtlstPrints_ctl0' + i + '_' + lblSourceid).innerText);
}
}
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?
Feb 16 '08 #1
1 964
r035198x
13,262 8TB
Can't you pass that value as a parameter to the Javascript function?
Feb 16 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Gowhera Hussain | last post by:
Use This for Learning Only .... Do Not Try To Act Smart HACKING WITH JAVASCRIPT Dr_aMado Sun, 11 Apr 2004 16:40:13 UTC This tutorial is an overview of how javascript can be used to bypass...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
2
by: Jens Körte | last post by:
Hi! I've got a typical newbie-problem, I guess. I got some selectboxes on my site. these boxes get their data from a databse. everything works fine, but when a user selects a value from one of...
3
by: Angel | last post by:
Hi, I have a page which shows a matrix of names and grades for given period. All the grades fields must be editable and they can be up to 200 fields (20 students with 10 grades each) Since...
0
by: deepak | last post by:
Hi all, i m transefering values from one listbox to another listbox using javascript(both are html controls), the first listbox is populating with database at page_load time and the second listbox...
1
by: Satish.Talyan | last post by:
hi, i want to create a dynamic tree hierarchy in javascript.there are two parts in tree, group & user.when we click on group then users come under that's tree category will be opened.problem is...
3
by: anthonybrough | last post by:
I have an asp page that has a form to collect user data in a form. when the user clicks submit the input is validated. If any fields are not acceptable the user clicks on a button to go back to...
5
by: Priya | last post by:
Hey all, I have some values in the database which has to retrieved and then passed on to some functions in the javascript. The javascript file is a separate file. I have included it in the aspx...
3
by: Aussie Rules | last post by:
Hi. I am using Live Earth SDK, and have very little Javascript knowledge, but I need to insert values into a Javascript function, where the vales are in the ASP.net VB code. The javascript...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.