homepage Welcome to WebmasterWorld Guest from 54.161.200.144
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Text gets added to Subject line after the default text - why?
JS mailing list code...form submission
Harley_m




msg:1493376
 8:28 pm on Oct 2, 2002 (gmt 0)

i downloaded some JS mailing list code from the net, and reduced it down till it was only the email section and submit button - which would mail the form entry to an email address with some subject included...so far very easy...

but now im finding it keeps putting "Form=Submit+Sub"after the text im putting into the subject of the email - it does it strait from the code too if i dont edit it - so its not something silly im doing...

i cant see it...whats wrong and what needs changing?

thanks so much

Harley

if you need it, heres the code :

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function resetform() {
document.forms[0].elements=="";
}
function submitForms() {
if (isEmail() && isFname() && isLname() && isAddress() && isCity() && isState() && isZip())
if (confirm("\n You are about to e-mail your submission. \n\nYES to submit. NO to abort."))
{
alert("\nYour submission will now be sent. \n\n Use the Return Button once the submission is complete to return to my home page.\n\n\n Thank you for joining our mailing list!");
return true;
}
else
{
alert("\n You have chosen to abort the submission.");
return false
}
else
return false;
}
function isEmail() {
if (document.forms[0].elements[1].value == "") {
alert ("\n The E-Mail field is blank. \n\n Please enter your E-Mail address.")
document.forms[0].elements[1].focus();
return false;
}
if (document.forms[0].elements[1].value.indexOf ('@',0) == -1
document.forms[0].elements[1].value.indexOf ('.',0) == -1) {
alert ("\n The E-Mail field requires a \"@\" and a \".\"be used. \n\nPlease re-enter your E-Mail address.")
document.forms[0].elements[1].select();
document.forms[0].elements[1].focus();
return false;

// End -->
</SCRIPT>

<body bgcolor="#FFFFFF">
<div align="center">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<p>&nbsp;</p>
</div>
<center>
<form enctype="text/plain" name="addform" method='get'
action='mailto:Enquiries@Example.co.uk?subject=hello'
onSubmit="return submitForms()">

<input type="hidden" name="Form" value="Submit Sub">
<table border=2 cellspacing=0 cellpadding=3 bgcolor="#C0C0C0">
<tr valign=baseline>
<td> <font face="Georgia, Times New Roman, Times, serif">Email Address:</font>
</td>
<td>
<input type=text name="Email Address" size=35,1 maxlength=80>
</td>
</tr>
</table>
<br>
<center>
<input type="submit" value="Submit" name="submit">
</center>
</form>
<p>
<p>
</center>
</body>

</html>

[1][edited by: Marcia at 10:03 pm (utc) on Oct. 3, 2002]
[edit reason] generic email replacement [/edit]

 

tedster




msg:1493377
 3:30 am on Oct 4, 2002 (gmt 0)

Let's focus on this line, which looks like the origin of your extra text. It's there as the value attribute of a hidden input named "Form":

<input type="hidden" name="Form" value="Submit Sub">

I didn't pull the code apart, but I'm guessing that "Form" is a bad choice of name for a hidden input and is crossing the wires somewhere.

Harley_m




msg:1493378
 12:26 pm on Oct 4, 2002 (gmt 0)

hmm, yes, but the code wont work without it, and so im a bit stuck....

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved