Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to email form data, as well as pass variable to results page. Can

Status
Not open for further replies.

noslenwerd

Programmer
May 2, 2005
59
US
Hello,

Basically what I would like to see happen is someone fill out this form, and have the information emailed to a certain email address...


And have the "Equipment cost" field pass on to the page below.... (actually have it pass directly to the results page, which you get after you click go on the link below)


Can this be done? I have a very very basic knowledge of ASP so please be gentle hah... Thanks!
 

if that doesn't work for you:




--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Thanks! I just made a test form... I have no problem creating the form, but am confused on how I can pass the equipmentCost value to the results.asp page...

Any tips on that? here is the code I am using now but its not working...

Response.Redirect("results.asp?" & equipmentCost)

But how do I get that equipment cost to calculate into the asp?

Thanks!
 
Code:
<form action="page2.asp" method="post">
<input type="text" [b]name="myTextBox"[/b] />
<input type="submit" value="submit" name="submit" />
</form>

Code:
<%
valueEntered = request.form("[b]myTextBox[/b]")
response.write valueEntered
%>

If on page1 your form uses a method of GET, replace request.form on page2 with request.querystring.

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
may i ask what response.write actually does?

and what do you mean by valueentered, or do I actually type that out?

I am a newbie at this

Thanks!
 
noslenwerd said:
may i ask what response.write actually does?
write a value to the screen

noslenwerd said:
and what do you mean by valueentered, or do I actually type that out?
seriously?

noslenwerd said:
I am a newbie at this
how new? are you acutally a programmer?


--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
sorry.. no need to be condescending

No I am not a programmer, I am a web designer. Not sure why it lists me as a programmer.

 
noslenwerd said:
sorry.. no need to be condescending

Even as a designer and someone who has posted claiming to know some PHP - you should know what a variable is and what a variable assignment looks like.

noslenwerd 6 Apr 09 said:
I have a bit of php experience so it wasn't too bad,


The equivilant of vbScript's request.form("myField") in PHP is $_POST['myField']; and for request.querystring("myField") is $_GET['myField'];.

If you are using POST the variable assignment in VBscript is (you don't start variables with a dollar sign in VBScript):

myVar = request.form("myField")

in PHP

$myVar = $_POST['myField'];


Anyway (end rant)

----

If you implement the code I provided, you'll see how to get a value from a form on one page and insert it into a variable and output it to the screen on a second page.

Now, instead of outputting it to the screen, simply assign that variable to the appropriate field on your mailing script.

Going back to the original link I sent you


and if you have a form with a text field where you collect the TO field (say the name attribute is "tbxTo" and you are using a "POST" method):

Code:
<%
valueEntered = request.form("tbxTo") [b]' get the value[/b]
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "Sending email with CDO"
myMail.From = "mymail@mydomain.com"
myMail.To = valueEntered [b]'assign it to the mailing object[/b]
myMail.TextBody = "This is a message."
myMail.Send
set myMail=nothing
%>

You may need to use one of the other examples on the w3schools page to get it working exactly how you want, I just used the first one as an example.




--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top