Variable from another form into email?

L

Larry L

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
 
G

Grant Wagner

Larry said:
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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top