Click here to Skip to main content
15,888,908 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Prevent text/image selection... Pin
Aman Bhullar27-Jan-10 22:14
Aman Bhullar27-Jan-10 22:14 
GeneralRe: Prevent text/image selection... Pin
Matt Gullett28-Jan-10 1:31
Matt Gullett28-Jan-10 1:31 
QuestionASP.Net Security Pin
Maxy5527-Jan-10 2:31
Maxy5527-Jan-10 2:31 
Questionhow to changes the cursor of html tag "area". Pin
nabber26-Jan-10 22:36
nabber26-Jan-10 22:36 
AnswerRe: how to changes the cursor of html tag "area". Pin
mrMercury27-Jan-10 5:28
mrMercury27-Jan-10 5:28 
Questionhiiiiiiii Pin
sheemap26-Jan-10 19:20
sheemap26-Jan-10 19:20 
AnswerRe: hiiiiiiii Pin
Andy_L_J26-Jan-10 19:29
Andy_L_J26-Jan-10 19:29 
Questionhow to add subtotal in javascript? Pin
jedongkendrick26-Jan-10 18:30
jedongkendrick26-Jan-10 18:30 
www.advance2000.net/upload/encode.php

if you look at that site i have a dynamic "table" that is filled out by the user, and i have the function in "onchange" that would change the subtotal values by multiplying the unit price and the quantity. here is the function of addrows of the dynamic table and the function for adding.

my problem is that the function only works for the first row and after that the value of the subtotal that is saved at the database is always 0. can someone help me through this?

function addRow(tbl,row){
row_no++;
if (row_no<=200){
if (row_no>=10){
var textbox = '';}
if (row_no<10){
var textbox = '';}
var textbox2 = '';
var textbox3 = '';
var textbox4 = '';
var textbox5 = '';
var tbl = document.getElementById(tbl);
var rowIndex = document.getElementById(row).value;
var newRow = tbl.insertRow(row_no);
var newCell = newRow.insertCell(0);
newCell.innerHTML = textbox;
var newCell = newRow.insertCell(1);
newCell.innerHTML = textbox2;
var newCell = newRow.insertCell(2);
newCell.innerHTML = textbox3;
var newCell = newRow.insertCell(3);
newCell.innerHTML = textbox4;
var newCell = newRow.insertCell(4);
newCell.innerHTML = textbox5;
}

if (row_no>200){
alert ("Too Many Items. Limit of 200");
}
}





function Sum() {

var q=document.getElementById("quantity[]").value

var x=document.getElementById("desc[]").value
var y=document.getElementById("itemno[]").value
var o=document.getElementById("ourcost[]").value
document.getElementById("ourcost[]").value=x*y



}

AnswerRe: how to add subtotal in javascript? Pin
Graham Breach26-Jan-10 23:16
Graham Breach26-Jan-10 23:16 
GeneralRe: how to add subtotal in javascript? Pin
jedongkendrick27-Jan-10 1:09
jedongkendrick27-Jan-10 1:09 
AnswerRe: how to add subtotal in javascript? Pin
Graham Breach27-Jan-10 4:05
Graham Breach27-Jan-10 4:05 
GeneralRe: how to add subtotal in javascript? Pin
jedongkendrick27-Jan-10 4:31
jedongkendrick27-Jan-10 4:31 
GeneralRe: how to add subtotal in javascript? Pin
Graham Breach27-Jan-10 8:04
Graham Breach27-Jan-10 8:04 
GeneralRe: how to add subtotal in javascript? Pin
jedongkendrick27-Jan-10 19:51
jedongkendrick27-Jan-10 19:51 
GeneralRe: how to add subtotal in javascript? Pin
jedongkendrick27-Jan-10 22:51
jedongkendrick27-Jan-10 22:51 
AnswerRe: how to add subtotal in javascript? Pin
Graham Breach27-Jan-10 23:09
Graham Breach27-Jan-10 23:09 
Questionjavascript converturl () - help with this function [modified] Pin
treeeen26-Jan-10 9:32
treeeen26-Jan-10 9:32 
AnswerRe: javascript converturl () - help with this function Pin
daveyerwin27-Jan-10 5:46
daveyerwin27-Jan-10 5:46 
GeneralRe: javascript converturl () - help with this function Pin
treeeen29-Jan-10 9:04
treeeen29-Jan-10 9:04 
GeneralRe: javascript converturl () - help with this function Pin
daveyerwin30-Jan-10 3:40
daveyerwin30-Jan-10 3:40 
QuestionHow to read client serial port from WebApplication Pin
Member 439056925-Jan-10 5:50
Member 439056925-Jan-10 5:50 
AnswerRe: How to read client serial port from WebApplication Pin
satwika.g17-Feb-10 10:47
satwika.g17-Feb-10 10:47 
AnswerRe: How to read client serial port from WebApplication Pin
mano_meee3-Oct-10 0:29
mano_meee3-Oct-10 0:29 
Questionretrieve scanned document Pin
Yosh_25-Jan-10 1:04
professionalYosh_25-Jan-10 1:04 
AnswerRe: retrieve scanned document Pin
David Mujica25-Jan-10 2:57
David Mujica25-Jan-10 2:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.