PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Using $_POST to get the values of checkbox fields.

  1. I am having trouble getting the values of fields that have an array such as the name, address, or checkbox fields. $_POST["input_fieldid"] works great when the value is a string such as text fields. I tried $_POST["input_2.1"] to get the value particular item in a checkbox but it does not return anything. Trying the same sort of thing also does not work with the name field using "3.3" for the first name, for example.

    Any help would be greatly appreciated.

    Thank you

    Posted 11 years ago on Monday July 23, 2012 | Permalink
  2. Try dumping (with var_dump or print_r) the $_POST array and you will see how to reference the $_POST values. From memory, I think the variables are converted from period to underscore though, for complex inputs like the name. For example, $_POST["input_2.1"] would become $_POST["input_2_1"]. You can try that, or dump the $_POST to see the names with 100% certainty.

    Posted 11 years ago on Tuesday July 24, 2012 | Permalink
  3. Using underscore instead of decimal worked perfectly--thanks so much!

    Posted 11 years ago on Tuesday July 24, 2012 | Permalink
  4. Great. Glad that worked out for you.

    Posted 11 years ago on Tuesday July 24, 2012 | Permalink

This topic has been resolved and has been closed to new replies.