Click to See Complete Forum and Search --> : more variable problems


erjohns
05-13-2005, 02:07 PM
Ok, I'm working on the mailform.asp page. This form already calls up variables from another page to fill in some entries in the email however it won't take the new variables I've created. It leaves a blank where the string should be. Here's an example of what I'm talking about:

<td nowrap><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Torque Constant:</font></td>
<td nowrap><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%= kt %></font></td>
<td nowrap><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%= ktu %></font></td>
</tr>

The kt variable gets posted however the ktu variable does not. If you need to see more let me know. I didn't want to c/p the code for 3 pages in here (no one would read that long of a post :) ).

David Harrison
05-13-2005, 03:33 PM
Well there's nothin wrong with that bit of ASP code, so it must be in the other 3 pages. Can you attach as a .txt so that we can give it a read through?

erjohns
05-13-2005, 04:07 PM
here ya go

David Harrison
05-13-2005, 04:51 PM
Try this: kmu = init & "/W<sup>1/2</sup>"
ktu = init & "/A"

erjohns
05-16-2005, 08:40 AM
but would that stop all of the following from showing?
tcsu, kmu, tfmaxu, jmsensu, whu, wfu, tpu, ktu, tmaxu

They show up on the table on the bdc page just fine but do not show up on the mailform

erjohns
05-16-2005, 11:47 AM
I'm wondering if this js function might be part of my problem.

function jsSendMail() {
oktogo = true;
errorMessage = "Please complete the following so we can help you:\n"
if(!document.forms[0].name.value){oktogo = false; errorMessage = errorMessage + "\nPlease enter your name.";}
if(!document.forms[0].company.value){oktogo = false; errorMessage = errorMessage + "\nPlease enter your company.";}
if(document.forms[0].phone.value.length < 7){oktogo = false; errorMessage = errorMessage + "\nPlease enter your phone number.";}
if(!document.forms[0].price.value){oktogo = false; errorMessage = errorMessage + "\nPlease enter a target price.";}
if(!document.forms[0].quantity.value){oktogo = false; errorMessage = errorMessage + "\nPlease enter an estimated quantity."}
if(document.forms[0].emailFrom.value) {
if(document.forms[0].emailFrom.value.indexOf("@") > 1) {
if((document.forms[0].emailFrom.value.length - document.forms[0].emailFrom.value.indexOf("@") < 3) || (document.forms[0].emailFrom.value.length - document.forms[0].emailFrom.value.indexOf("@") > 20)) {
oktogo = false;
errorMessage = errorMessage + "\nImproperly formatted email address."
}
}
else {
oktogo = false;
errorMessage = errorMessage + "\nUnrecognizeable email address."
}
}
else {oktogo = false; errorMessage = errorMessage + "\nPlease enter your email address."}
if( oktogo ) { document.forms[0].sendEmail.value = 'true'; document.forms[0].action = 'bdc.asp'; document.forms[0].submit(); } else {alert(errorMessage);}
}

Shouldn't the action read as follows (like the form later on) action = 'bdc.asp#data'. This page seems to go in many directions at once and I can't see the flow of it to know where to look, but this is my instinct yelling at me about the action line in this script.

phpnovice
05-16-2005, 11:56 AM
Here's an example of what I'm talking about:

<td nowrap><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Torque Constant:</font></td>
<td nowrap><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%= kt %></font></td>
<td nowrap><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%= ktu %></font></td>
</tr>

The kt variable gets posted however the ktu variable does not.
Do you mean display in a browser or post in a form? I ask because the bit of HTML shown is not what is responsible for POSTing data. There has to be FORM elements that represent the kt and ktu values.

erjohns
05-16-2005, 12:47 PM
kt and ktu are both variables that are generated in a calculate.asp file. Those variables display on the main page (bdc.asp). After looking at the code, yes these variables are in a table that's part of the form that runs on the main page. The variables do display on the main page but vars like ktu (new set) do not. Basically I have the numbers(kt) but not the units of measure(ktu) when the email is transmitted.

phpnovice
05-16-2005, 01:17 PM
...yes these variables are in a table that's part of the form that runs on the main page. The variables do display on the main page but vars like ktu (new set) do not.
Still, a point of distinction must be made here. You said, "these variables are in a table that's part of the form..." However, just being in the table will not cause these variables to POST as part of the form. The question is... Do you have FORM fields set for these variables?

phpnovice
05-16-2005, 01:21 PM
Also, what Mr. Harrison was trying to tell you is that the "+" sign is not used for concatenation in ASP/VBScript. The ampersand is used for that. You have this in your calculate page -- which will cause a type mismatch error:

kmu = init + "/W<sup>1/2</sup>"
ktu = init + "/A"

Change that to the following:

kmu = init & "/W<sup>1/2</sup>"
ktu = init & "/A"

erjohns
05-16-2005, 02:28 PM
Still, a point of distinction must be made here. You said, "these variables are in a table that's part of the form..." However, just being in the table will not cause these variables to POST as part of the form. The question is... Do you have FORM fields set for these variables?


The fields in the table are just like on the mailform <%= kt %> <%= ktu %>. kt displays and posts, ktu does not.

phpnovice
05-16-2005, 03:15 PM
Then you are not sending/calculating the ktu variable value to/on the mailform page.

erjohns
05-16-2005, 03:42 PM
Then I'm not sure where to look for that?

phpnovice
05-16-2005, 04:51 PM
How does the kt variable get to the mailform page?

erjohns
05-17-2005, 09:36 AM
kt is a variable that is generated on a calculation page. The only means of it's transferance is through <%= kt %> both on the main page and on the mailform page.

All of the variables are declared properly. If you look at an earlier post of mine the source code for all 3 pages is there. I've looked through all 3 for a while now and I still can't find where the problem lies.

phpnovice
05-17-2005, 05:53 PM
You cannot transfer data between pages solely by means of a <%= kt %> specification.