Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem with function updateSum(id)

Familiar Sight
 
Join Date: Oct 2007
Posts: 254
#1: Dec 1 '07
Hi there.

I have a problem with function updateSum(id).

The code is this:

[php]

<script language="javascript" type="text/javascript">
<!--


function updateSum(id)
{

var frmObj = document.frmEnquiry;

frmObj["netto_2_x_100_" + id].value = (parseFloat(frmObj["netto_" + id].value) * 0.02).toFixed(2);


}


var timerID = null;

window.clearTimeout()

var flTimeout = (typeof(window.setTimeout) != "undefined" &&
typeof(window.clearTimeout) != "undefined");


function deferUpdate(id)
{

if (timerID != null) window.clearTimeout(timerID);


if (flTimeout) timerID = window.setTimeout("timerID = null; updateSum(" + id + ");", 400);
else updateSum(id);
}

//-->
</script>

<form method="POST" name="frmEnquiry" ...>

<input type="text" name="netto_2_x_100_<%= strID %>" onkeyup="deferUpdate(<%= strID %>)">
[/php]

The error is:

'undefined' it is null or not an object

On the line

[php]
frmObj["netto_2_x_100_" + id].value = (parseFloat(frmObj["netto_" + id].value) * 0.02).toFixed(2);
[/php]



Can you help?
Thanks

Viki1967

gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#2: Dec 2 '07

re: Problem with function updateSum(id)


could you trace what the passed id is?

kind regards
Familiar Sight
 
Join Date: Oct 2007
Posts: 254
#3: Dec 2 '07

re: Problem with function updateSum(id)


Your's Sincerely, but the problem was server remote what a not working, no this script.

Now it is ok.

Viki1967
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#4: Dec 2 '07

re: Problem with function updateSum(id)


glad to hear you got it working ... post back to the forum anytime you have more questions :)

kind regards
Reply