Advanced Search

Results 1 to 2 of 2

Thread: Checked / unchecked error messages

  1. #1
    Join Date
    Oct 2012
    Posts
    129
    Thanks
    15
    Thanked 1 Time in 1 Post

    Default Checked / unchecked error messages

    On one of my pages if both checkboxes are checked this error will show up:


    Code:
                if ($_POST['promote']['multicity_co'] && $_POST['promote']['multicity_cf'])
                    $err .= "&bull; please, select only ONE paid promotion<br>";
    My question is, what code should I use to give an error message if NONE of the checkboxes are checked?

    Thank you in advance.

  2. #2
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    47
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    I assume you could use something like this:
    PHP Code:
                if (!isset($_POST['promote']['multicity_co']) && !isset($_POST['promote']['multicity_cf']))
                    
    $err .= "&bull; please, select a paid promotion<br>"
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  3. The Following User Says Thank You to bernie1227 For This Useful Post:

    qwikad.com (11-26-2012)

Similar Threads

  1. Error messages in IE
    By GodLovesDemeter in forum JavaScript
    Replies: 6
    Last Post: 08-15-2007, 06:09 AM
  2. Error Messages
    By techno_race in forum Picture Gallery
    Replies: 16
    Last Post: 07-28-2007, 09:32 PM
  3. Help with error messages
    By Sarah w in forum HTML
    Replies: 8
    Last Post: 02-07-2007, 06:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •