Variable from another form into email?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Larry L

    #1

    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

  • Grant Wagner

    #2
    Re: Variable from another form into email?

    Larry L wrote:
    [color=blue]
    > 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[/color]

    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['myClientSideVa lue'].value = someVariable;re turn
    true;">
    <input type="hidden" name="myClientS ideValue" 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 <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    Working...