Gossamer Forum
Home : General : Perl Programming :

column name in javascript

Quote Reply
column name in javascript
I want to use a script like the following

<script language="JavaScript">
function calculate(form1)
{
var subt = parseFloat(form1.subtotal.value);
var sale = parseFloat(form1.salestax.value);
var tax = subt*sale;
var tprice = subt+tax;
form1.linetotal.value = tprice
}
</script>



There seems to be a problem because of the column name.
Instead of subtotal I would need to use Final_Amount
The _ between Final and Amount is maybe a problem.

If I test it with another field which has only one word as column name, it works.

How can I get it running with the name Final_Amount?

--
Michael Skaide

http://www.cycle24.de

Quote Reply
Re: [Michael Skaide] column name in javascript In reply to
I think I got it running with an hidden input whit another var name

--
Michael Skaide

http://www.cycle24.de

Quote Reply
Re: [Michael Skaide] column name in javascript In reply to
Quote:
I think I got it running with an hidden input whit another var name

Sounds like something I'd do....Tongue

from the JavaScript Bible 3rd Ed
JavaScript Object Names:
May not contain spaces
Should not contain punctuation except for the underscore character
Must not start with a numeric character

Don't know why your name didn't work. Maybe it had something to do with upper/lowercase? Sometimes you just have to close out your browser and "suddenly" your script starts working. Often referred to as a "JOOTT" (Just One Of Those Things).