What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    php variable name for fields that include "Other" entries

    Asked by macpooh 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.

    name JotForm style POST
  • Profile Image
    JotForm Support

    Answered by abajan 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

    Answered by macpooh 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
    JotForm Support

    Answered by EltonCris on February 05, 2013 at 12:05 AM

    Hi,

    How about this?

    $_POST[childsGuardian77][0];

    I think this works. Thanks!

  • Profile Image

    Answered by macpooh on February 05, 2013 at 12:32 AM
    http://storyized.com/order.htm
    ________________________________
  • Profile Image
    JotForm Support

    Answered by EltonCris 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!