Hi,
I'm not exactly a phplist tyro, but not expert, either. I've read this thread from beginning to end, so I know that this question isn't new, but I'm stuck. My custom page just sends users to the default phplist subscribe page on submit. I think I've followed all instructions correctly. Here's the JavaScript (taken from the phplist-generated version on the page):
- Code: Select all
<script language="Javascript" type="text/javascript">
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;
}
}
if(! compareEmail())
{
alert("Email Addresses you entered do not match");
return false;
}
return true;
}
var fieldstocheck = new Array();
var fieldnames = new Array();
function addFieldToCheck(value,name) {
fieldstocheck[fieldstocheck.length] = value;
fieldnames[fieldnames.length] = name;
}
function compareEmail()
{
return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}
</script>
Here's the form definition (note that I've followed the suggestion made just above re: using onSubmit instead of onClick) Also, i can't post URLs, so I had to use a meta URL <mydevserver>:
<form method="post" action="<mydevserver>/lists/?p=subscribe" name="subscribeform" onSubmit="return checkform();">
Here's the hidden field (note I'm using full quotes, as suggeted):
<input type="hidden" name="list[2]" value="signup">
I have searched for, found and removed the following line:
<input type="hidden" name="listname[2]" value="test"/>
on submitting the form, users end up at: <mydevserver>/lists/?p=subscribe
This looks just the phplist default subscribe page for this list (all form fields are filled in) although the URL for that would be <mydevserver>/lists/?p=subscribe&id=2. This happens on IE7 and Firefox.
No doubt I am missing something, but I'm blind to it. Any help greatly appeciated.