If you followed the instructions on the
original doc's page about embedding a form, where's the javascript to check the input?
Also, you can only check for a single entry the way you have it set up.
You ask on the main page for their email address, BUT on your subscribe page you also ask for email confirmation, first and last names as well as gender but none of these are asked for initially, so they are not passed to your actual subscribe form thus it beings up the normal subscribe page.
The code on the very first page of this topic, 2nd post, works as is, still.
- Code: Select all
<!-- newsletter subscribe below here -->
<script language="Javascript" type="text/javascript">
var fieldstocheck = new Array();
fieldnames = new Array();
function checkform() {
for (i=0;i<fieldstocheck.length;i++) {
if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "") {
alert("Please enter your "+fieldnames[i]);
eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
return false;
}
}
return true;
}
function addFieldToCheck(value,name) {
fieldstocheck[fieldstocheck.length] = value;
fieldnames[fieldnames.length] = name;
}
</script>
<form method="post" action="http://www.yourdomain.com/lists/?p=subscribe&id=1" name="subscribeform">
Email:<input type="text" name="email" value = ""><br>
<script language="Javascript" type="text/javascript">addFieldToCheck("email","Email Address");</script>
Name: <input type="text" name="attribute2" value = "">
<script language="Javascript" type="text/javascript">addFieldToCheck("attribute2","Name");</script>
<input type="hidden" name="list[1]" value="signup" />
<input type="submit" name="subscribe" value="Subscribe" onClick="return checkform();">
</form>
<!-- newsletter subscribe ends here -->
Whereas your code is just:
- Code: Select all
<div id="newsWrapper">
<div id="newsContainer">
<span>KEEP UP TO DATE WITH ALL THE LATEST NEWS & OFFERS</span>
<form method="post" action="http://www.your domain.co.uk/newsletters?p=subscribe&id=3" name="subscribeform">
<input type="text" name="email" value="" size="36">
<input type="hidden" name="list[3]" value="signup">
<input type="submit" name="subscribe" value="Subscribe">
</form>
</div>
</div>
No javascript to check the email and only a single email request.
Try it and see, you'll even get a confirmation email (that you can ignore as the list is only a demo).
My Embed Demo 1If you also would like to try
this version which asks for confirmation of email as well as your name AND opens the Thank you page in a popup window too.