473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Variable from another form into email?

I'm pretty novice at javascript, and it took me this long to understand
what is happening in my page so far.

On my page I do several things, requiring user input, to create a variable
that I then want to send via formmail. I create the variable globally, and
at that point the variable is empty. I have a form that runs some other
javascript that creates the value (a string) in the variable, then I have
a simple second form with a button you click to display it, then a third
form that asks for yor name, and sends the name and string via email. The
first 2 are working and the 3rd sends the email, but I can't figure out
how to send the variable value in it. Any suggestions for a mostly novice?

Thanks much,
Larry

Jul 23 '05 #1
1 1322
Larry L wrote:
I'm pretty novice at javascript, and it took me this long to understand
what is happening in my page so far.

On my page I do several things, requiring user input, to create a variable
that I then want to send via formmail. I create the variable globally, and
at that point the variable is empty. I have a form that runs some other
javascript that creates the value (a string) in the variable, then I have
a simple second form with a button you click to display it, then a third
form that asks for yor name, and sends the name and string via email. The
first 2 are working and the 3rd sends the email, but I can't figure out
how to send the variable value in it. Any suggestions for a mostly novice?

Thanks much,
Larry


I have no idea what you are talking about, but in general, it's pretty simple
to pass a client-side value to your form processing on the server:

<script type="text/javascript">
var someVariable = 'something or other';
</script>
<form name="myForm" method="GET" action=""
onsubmit="this.elements['myClientSideValue'].value = someVariable;return
true;">
<input type="hidden" name="myClientSideValue" value="">
<input type="submit" name="btnSubmit" value="Test">
</form>

Of course, the hidden input can be set anywhere, by any action (button press,
link click, onload event, etc).

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jonathan | last post by:
I'm puzzled by Python's behavior when binding local variables which are introduced within exec() or execfile() statements. First, consider this simple Python program: # main.py def f() : x = 1...
6
by: Al Jones | last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate group would you point me toward one that is. Basically, I seem to be losing session data part way though preparing an...
8
by: Groups User | last post by:
C allows type casting in which a variable is converted from one type to another. Does C (whatever standard) allow the type of a variable to change, within a statement, avoiding the conversion?...
2
by: John Holmes | last post by:
I have a web interface where the user types in ID's one at a time. After an ID is typed in, a button is clicked and the button click event has code that does a query and returns a data reader and...
4
by: - Steve - | last post by:
I have a cs file I use in an ASP.NET form. The class has several member variables. If I assign a value to those variables in a method, when I get to another method the variable no longer equals...
23
by: lwoods | last post by:
I am trying to pass some info to another page on my site. I set "session_start()" in page 1, assign a session variable to a value, then execute a "header('Location: ....')." But on the target...
10
by: Mark A. Sam | last post by:
Hello, I am using Visual Web Developer and decared a Public Variable in the Class section. I assigned a value in the load section, and on a button I set it up to increment, but it always...
7
by: Garry Jones | last post by:
I have an entry page which can be used to key in data for ten people. My assigned variables for each field are in line with $personage1 $personage2 ....etc $personage9 $personage10 and so...
6
by: leppert | last post by:
Hello, I am trying to access a javascript variable on another site. The site requires the user to be logged in, so what I am doing is submitting a form and redirecting the output to an IFRAME,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.