Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:06:39+00:00 2026-06-03T16:06:39+00:00

This question assumes familiarity with FormStack , a drag-and-drop WYSIWYG online form builder. Background

  • 0

This question assumes familiarity with FormStack, a drag-and-drop WYSIWYG online form builder.

Background

A client is using FormStack to manage forms. Currently, form submissions are emailed, then manually entered into a database. Predictably, my task is to automate this process. This is easy enough using FormStack’s WebHooks API: I can have form submissions sent to a URL, e.g. a PHP script, and happily parse away.

Question

Is it possible to name (or tag) FormStack fields with simple identifiers?

The client needs to be able to customize the form such that multiple fields may feed into the same database column.* FormStack however, as far as I can tell, provides only a way to specify a field label, e.g. Which of these trips interest you?, not a programmer-friendly identifier, e.g. Trip. My script would have to string-compare labels (which, due to their length, are more prone to typos) to determine what to do. What are some sensible workarounds to this problem?

Clarifications*

The reason there can exist multiple fields that feed into the same database column, is that the client uses conditional fields. For example, one field might ask, Where are you studying abroad? If the user selects “Europe”, a conditional field might appear, asking Which of these trips interest you?, with choices pertaining to Europe. If the user selects “Africa” however, a similar field might appear, e.g. Which of these trips interest you?, but with choices pertaining to Africa. In FormStack, these are actually two distinct fields. However, as you can imagine, the values belong in the same database column, Trip.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:06:41+00:00Added an answer on June 3, 2026 at 4:06 pm

    I have settled on a hack for now. FormStack allows HTML markup in labels, e.g. Which of these trips interest you? <!--Trip-->. The client is willing to “tag” fields in this way.

    Here’s a snippet of the code that parses such tags, in case it might help someone else:

        require_once 'Formstack.php';
        $formstack = new Formstack($apiKey);
        $form = $formstack->form($_POST['FormID']);
        $taggedFields = array();
        foreach ($form['fields'] as $field)
        {
            if (preg_match('/<!--\s*([0-9A-Za-z]+)\s*-->/',
                           $field['label'],
                           $matches))
            {
                $taggedFields[$matches[1]] = $_POST[$field['id']];
            }
        }
    

    In fact, I’ve had to make it a little bit more sophisticated. Some FormStack field-types serialize input (in a horrific way). For example, FormStack’s Name field-type takes multiple fields (prefix, first, middle, last, initial, suffix), and concatenates the results into a string:

    'first = Andrew
    initial = W
    last = Cheong'
    

    To handle this, I’ve written my code to handle such syntax in labels as Tell us your name! <!--FirstName=first--> <!--LastName=last--> <!--MiddleInitial=initial-->

    The code follows.

        require_once 'Formstack.php';
        $formstack = new Formstack($apiKey);
        $form = $formstack->form($_POST['FormID']);
        $taggedFields = array();
        foreach ($form['fields'] as $field)
        {
            if (preg_match_all('/<!--\s*([0-9A-Za-z]+)\s*(?:=\s*(\w+))?-->/',
                               $field['label'],
                               $matches,
                               PREG_SET_ORDER))
            {
                foreach ($matches as $captures)
                {
                    if (count($captures) == 3 &&
                        preg_match('/(?:^|\n|\r)'.$captures[2].' = ([^\n\r]+)/',
                                   $_POST[$field['id']],
                                   $subcaptures))
                    {
                        $taggedFields[$captures[1]] = $subcaptures[1];
                    }
                    else
                    {
                        $taggedFields[$captures[1]] = $_POST[$field['id']];
                    }
                }
            }
        }
    

    Hopefully, FormStack will soon add a native way to name or tag fields!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question assumes there's a blessed central repository that members of a team clone
Background I'm making a canvas game which assumes the user to be using a
Inspired by this question , the asker assumes that the users of a system
This question assumes that the python package I want to install is a django
For this question, let us assume that we will want to show the face
(For the purposes of this question, let us assume that one is intentionally not
This is a question about generic c++ event driven applications design. Lets assume that
This question is about programming small microcontrollers without an OS. In particular, I'm interested
This question seems to be the essence of several others on this forum. I
This question already has an answer here: What are Extension Methods? 5 answers Usage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.