If you puy that javascript into a static html page does it work? If so compare the static page's working javascript to the script generated javascript. Did you backslash any single or double quotes? It could be that perl treats them like this :
Original javascript : d1_12 -= eval('theform.num'+i).value But it gets printed as : d1_12 -= eval(theform.num+i).value Unless you do this in your script d1_12 -= eval(\'theform.num\'+i).value Could be, try that and see if it works Dan -----Original Message----- From: Janfek Esquivel [mailto:[EMAIL PROTECTED]] Sent: Friday, December 27, 2002 11:02 AM To: [EMAIL PROTECTED] Subject: Simple Question I have a cgi that gets variables from a form (only numeric) and that form is sent to a text file to get the information that I need later. What I'm having problems with is that I need some fields to add themselves and display different totals on the same form when a modification is made to one of those fileds. I used a Javascript and tested it on an html, it works, but it doesn't seem to work on my cgi. Is there something I'm doing wrong, is there something else I can do? Your help will be appreciated. Here is the javascript I'm using and also I attach the cgi. Thanks in advance. Janfek Esquivel. <script language="JavaScript"> <!-- var totalBoxes = 11; function updateTotal(theform) { var d1_12 = 0; for (var i = 1; i < totalBoxes + 1; i++) { d1_12 -= eval('theform.num'+i).value; } theform.d1_12.value = -d1_12; } // --> </script> _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 3 months FREE*. http://join.msn.com/?page=features/featuredemail&xAPID=42&PS=47575&PI=7324&DI=7474&SU= http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_addphotos_3mf -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]