I have a php form, that uses a javascript word counter to make sure
submissions are a certain number of words, I have now been tasked with
taking that word count and having it pass in the email that gets sent when
someone submits a form ..in the subject line.
Here is the code I'm using so far.  Is it possible to just echo a
javascript  variable on a page like you can a php var?

// Enter in a subject line for the email.
$_SESSION['EmailSubject'] = "Letter to the Editor  echo('submitcount')";
<---- I want to just echo it..possible??

//Thank you text
$_SESSION['ThankYou'] = "Thank you for participating\\n\\nYour comments have
been sent to our newsroom. \\nIf our writers or editors have any questions
about your letter, you will receive a reply via phone or e-mail. ";


<script language="javascript">
  var submitcount=0;
   function checkSubmit() {

      if (submitcount == 0)

function wordCounter(field, countfield, maxlimit) {
for (x=0;x<field.value.length;x++) {
      if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ")
{wordcounter++}  // Counts the spaces while ignoring double spaces, usually
one in between each word.
      if (wordcounter > 300) {field.value = field.value.substring(0, x);}
      else {countfield.value = maxlimit - wordcounter;}

function textCounter(field, countfield, maxlimit) {
  if (field.value.length > maxlimit)
      {field.value = field.value.substring(0, maxlimit);}
      {countfield.value = maxlimit - field.value.length;}

===================END CODE==========================================

Happy Freecycling
Free the List !!
Over Moderation of Freecycle List Prevents Post Timeliness.
Report Moderator Abuse Here:
Or Email Your Complaint to:
f...@freecycle.org or i...@freecycle.org
<a href="http://www.facebook.com/people/Terion-Miller/1542024891";
title="Terion Miller's Facebook profile" target=_TOP><img src="
http://badge.facebook.com/badge/1542024891.237.919247960.png"; border=0
alt="Terion Miller's Facebook profile"></a>

Reply via email to