Author Topic: Multiple Subscriptions  (Read 1707 times)

josephsimon

  • Posts: 3
    • View Profile
Multiple Subscriptions
« on: December 08, 2004, 02:38:16 am »
I have my form set up for multiple subscription check boxes.  But if someone does not select at least one.  They will get the following error:

Warning: Variable passed to each() is not an array or object in /home/mydenta/public_html/mail_list/signup.php on line 57

Warning: reset(): Passed variable is not an array or object in /home/mydenta/public_html/mail_list/signup.php on line 123

Warning: Variable passed to each() is not an array or object in /home/mydenta/public_html/mail_list/signup.php on line 126

How can I set it up to give them a custome error message like "you must select at least one subscription"?

Cheers,
JSI

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Multiple Subscriptions
« Reply #1 on: December 08, 2004, 09:24:32 am »
Hmm, an error check for this could be missing.  I will have to look into it.

For now, I recommend using JavaScript in your form.  Something like this could work:

Code: [Select]
<form method=post action=http://yoursite.com/mail/signup.php onsubmit="if(!lists[0]){ alert('You must select at least one list!'); return false; }">
</form>
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

porl

  • Posts: 9
    • View Profile
Multiple Subscriptions
« Reply #2 on: January 04, 2005, 11:09:52 pm »
I had that problem as well.
got around it by putting in a hidden field so that everyone goes onto a hidden master list.
Hope that helps.