php variable name for fields that include "Other" entries

  • Profile Image
    macpooh
    Asked on February 04, 2013 at 05:49 PM

    Does anyone know what the variable/array name is for fields that offer an "other" entry or how I could find it on the JotForm site?  I want to be able to post form user's entries on a php thank you page however the field name is only displaying the known values but not the unknown variable from an "Other" input field.  For example:

     

    Child's Guardian
    Mom and Dad Single Dad Single Mom

     

    The name for this field is childsGuardian77 so in a php post (<?php $childsGuardian77 = $_POST[childsguardian77];?>), it will print the first three know values (Mom & Dad, Single Mom, Single Dad) when one of those is selected.  But if the "Other" choice is selected, no matter what is typed into the input box, what is displayed on the thank you page is "Array".  There has to be something else in the field name that identifies and displayes the unknown variable.  Thank you for your asistance with this matter.

  • Profile Image
    abajan
    Answered on February 04, 2013 at 07:17 PM

    This is a bit of a longshot but try pointing a separate variable to

    $_POST[childsGuardian77[other]]

    and let us know if that helps.

  • Profile Image
    macpooh
    Answered on February 04, 2013 at 10:12 PM

    Yeah, I had already tried that but that's not the naming convention that's being used in your DB.  What is being used in the autoresponder and notification emails because the variables are being properly displayed in those?  I don't have access to that code so there is no way for me draw a reference.
    ________________________________

  • Profile Image
    EltonCris
    Answered on February 05, 2013 at 12:05 AM

    Hi,

    How about this?

    $_POST[childsGuardian77][0];

    I think this works. Thanks!

  • Profile Image
    macpooh
    Answered on February 05, 2013 at 12:32 AM
    http://storyized.com/order.htm
    ________________________________
  • Profile Image
    EltonCris
    Answered on February 05, 2013 at 01:04 AM

    Hi,

    Thanks for that details. Anyway, after making a test with your form the "G" isn't capital. So use the following.

    $_POST[childsguardian77][0];

    You can use the same way for the other fields with "other' option. Just replace the field name and add the index 0 e.g. [0]. I believed "Other" option always have 0 index since it's the only option with text box on radio button fields.

    Thanks!