Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: JS and FormMail
11-21-2010, 05:32 PM #1
- Join Date
- Nov 2010
- Guttenberg, NJ
- Thanked 0 Times in 0 Posts
JS and FormMail
Google groups emails by “Subject.” Unfortunately, there is no way to keep emails with the same “Subject” separate. I am using FormMail to receive comments and questions from viewers. Before, I was specifying the “Subject” as “Comments/Questions.” Therefore, Google grouped all the emails. And, I wanted to keep the email separate.
To separate the emails, I changed the code as follows:
[Here is some of the code used for validation which works fine!]
var subject_random="CQ" + Math.floor(Math.random)()+999999) + 1; [Here I set the
Then in FormMail, I show:
<input type="hidden" name="subject" value=subject_random>
When the form is submitted, the Subject in the email appears as “subject_random.”
11-21-2010, 10:06 PM #2
You'd have to doto create that field.Code:document.write('<input type="hidden" name="subject" value="' + subject_random + '">');
Or, if the field already exists, you could doBut that must be done *AFTER* the </form> tag is processed by the browser. So either put the JS at the end of the page or use <body onload="..."> to do it.Code:document.forms.subject.value = subject_random;
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.