PHP Formail Checkboxes Problem

Discussion in 'PHP' started by captainron19, Jan 27, 2009.

  1. #1
    I am using a form that I will need multiple checkboxes.

    My intention is to have the days of the month listed for people to submit their availability to work

    1st
    2nd
    3rd
    etc etc

    Each day will have two check boxes: Days and Nights

    Every time I try to input these fields into the formmail I am using the email showing the data just shows: "Array"

    Can anyone help me with what I am doing wrong?

    her eis an example of the checkboxes for the first day of the month

    1st: Days: <input type="checkbox" name="1st[]" value="Days"><br>
    Nights: <input type="checkbox" name="1st[]" value="Nights"><br>
     
    captainron19, Jan 27, 2009 IP
  2. Gangsta

    Gangsta Active Member

    Messages:
    145
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    you are using name="1st[]"
    it is array

    so just use for exapmle
    1st: Days: <input type="checkbox" name="1st_days" value="Days"><br>
    Nights: <input type="checkbox" name="1st_nights" value="Nights"><br>
     
    Gangsta, Jan 27, 2009 IP
  3. captainron19

    captainron19 Active Member

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #3
    I guess mainly I was doing the array for the reason to have the data sent in the email appear as:

    1st: Days, Nights (For when someone submitted availability for both the day and night shift on the 1st of the month)

    With the coding you gave me I really dont even need a value placed in because when someone selects the checkbox it places whatever name that check box is in the email.

    Does anyone have any recommendation ont he easiest way to do this sort of thing? It is for my ambulance squad.

    Ideally I would like for the email with the data to look as neat and easily read as possible
     
    captainron19, Jan 27, 2009 IP