<form method="POST" action="sendmail.cgi">
<script type="text/javascript">
document.write('<input type="hidden" name="stuff" value="' + yourVariable +
'">');
</script>
<input type="submit" value="Send Stuff">
</form>
If yourVariable may contain quotation marks or new line characters, you must
either remove them, replace them, or escape them.
Grant,
Well it took me this long to understand what is happening in my page. Your
script, of course, works perfectly by itself. However, on my page I do
several things, requiring user input, to create the variable that I then
want to send via formmail. As I understand it, your code executes as the
page loads, 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. Any further
suggestions for the 3rd?
Thanks much,
Larry