gtennant
January 26th, 2006, 05:59 PM
Hi,
I have a piece of code snippet, that I'd like to use to add two numbers, and what I was wondering about, is why DreamWeaver 8 is showing a portion of the code section in red? I have an idea it has to do with fields that start with numbers, but I was told be the person running the site where the form is being submitted to, that in order for my submitted form to have the fields in the order I want them, when they are received by e-mail, that I would need to put numbers in front. Otherwise first_name is 4 or 5 lines away from last_name, in the resulting e-mail message.
Here's the code:
<SCRIPT language = JavaScript>
function calculate() {
A = document.form2.17_gross_monthly.value
B = document.form2.18_other_income.value
A = Number(A)
B = Number(B)
C = (A + B)
document.form2.19_total_gross_income.value = C
}
</SCRIPT>
The ".##" portions are highlighted, by DreamWeaver 8, in red. I am assuming the script will fail because a ".##" is following the "2" in "form2", and it doesn't know that the "2" is part of the form name.
Is there a better way to add these two "number-first" fields?
Is there a better way to sort the fields before they are submitted to the form processor at: https://www.big-llc.com/formmailer/submit without having to use numbers first, on the field names?
Many thanks in advance!
Gil
I have a piece of code snippet, that I'd like to use to add two numbers, and what I was wondering about, is why DreamWeaver 8 is showing a portion of the code section in red? I have an idea it has to do with fields that start with numbers, but I was told be the person running the site where the form is being submitted to, that in order for my submitted form to have the fields in the order I want them, when they are received by e-mail, that I would need to put numbers in front. Otherwise first_name is 4 or 5 lines away from last_name, in the resulting e-mail message.
Here's the code:
<SCRIPT language = JavaScript>
function calculate() {
A = document.form2.17_gross_monthly.value
B = document.form2.18_other_income.value
A = Number(A)
B = Number(B)
C = (A + B)
document.form2.19_total_gross_income.value = C
}
</SCRIPT>
The ".##" portions are highlighted, by DreamWeaver 8, in red. I am assuming the script will fail because a ".##" is following the "2" in "form2", and it doesn't know that the "2" is part of the form name.
Is there a better way to add these two "number-first" fields?
Is there a better way to sort the fields before they are submitted to the form processor at: https://www.big-llc.com/formmailer/submit without having to use numbers first, on the field names?
Many thanks in advance!
Gil