Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 28th, 2004, 01:16 PM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default Form Variables

Hey,

Anyone know if you can pass variables within a form to an e-mail body?

This is more or less what I have codewise:

<form name ="form1">
<BR>
<input type ="text" name ="yourname"><BR>
<input type ="button" name ="passtobody" value ="Pass to Body" onclick ="pass_variable_to_body()">
</form>
<script language ="javascript">
function pass_variable_to_body(){
var bodyvar=document.form1.passtobody.value
location.href="mailto:me@mydomain.com&subject=What ever&body=howthehelldo I get the value of the variable called bodyvar to appear here"
</script>

__________________
\'sync\' &lt;cr&gt;
The name specified is not recognized as an internal or external command, operable program or batch file.
Reply With Quote
  #2 (permalink)  
Old June 28th, 2004, 01:19 PM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry, forgot there should be a "}" at the end of the script.

interrupt

Reply With Quote
  #3 (permalink)  
Old June 28th, 2004, 04:22 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Try this:

location.href="mailto:me@mydomain.com?subject=What ever&body="+bodyvar;

HTH,

Snib

<><
Reply With Quote
  #4 (permalink)  
Old June 29th, 2004, 07:00 AM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Brilliant!

Quote:
quote:Originally posted by Snib
 Try this:

location.href="mailto:me@mydomain.com?subject=What ever&body="+bodyvar;

HTH,

Snib

<><
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing variables from 1 form to another. jainin_shah9 C# 10 February 18th, 2008 07:59 PM
Grabbing form variables jroxit Classic ASP Basics 5 June 18th, 2007 05:08 PM
Saving form variables after a reload, rinventive Pro PHP 8 June 23rd, 2006 04:49 AM
Submitting a form via a link with variables mswombat Classic ASP Basics 5 November 6th, 2005 06:33 PM



All times are GMT -4. The time now is 01:10 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.