Please Note: We are no longer using forums to facilitate standard support. 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.

Add new fields to form dynamically using a button or link

  1. I need to know if I can have a button which will add additional fields to my form dynamically. Like adding a new row to a database or spreadsheet.
    [add new entry] = new set of fields conditionally.

    I saw a response to this in the forums, unfortunately I was unable to read it. Maybe opening up forums for support would be a good idea, and make direct inquiries part of the licensing cost?

    Thanks

    Posted 3 years ago on Tuesday December 7, 2010 | Permalink
  2. No, Gravity Forms does not have the ability to add additional feeds dynamically in this way. All fields have to be created in the form builder. You can show/hide fields based on user selections, but you can't dynamically create a new block of fields. This is because Gravity Forms needs to know how to store and display this information so it needs to have the fields preset in the form builder in order to do so.

    Pre-Sale Questions is open to anyone. The Support Forum, however, is only available to customers. Support is one of the things you are paying for when you purchase Gravity Forms and that is why it is closed off.

    Posted 3 years ago on Tuesday December 7, 2010 | Permalink
  3. supplyguy
    Member

    Dang. I just found out about this plugin, and went right to this question. Would solve so many issues if this was possible. Just to be sure I'm looking for the same feature as coreycauble, let me re-ask it this way.

    I want to use Gravity Forms to allow my unregistered public users to add information about stuff. On my submission form, I keep it basic. The post title followed by Label / Value information for describing an item. Finally a human checker / Capcha before the submit button. For example, WEIGHT is a Label and 27lbs. is a Value.

    For my application, adding new Label / Value text fields would work. I noticed in your Demo that I could add a Custom Field under Post fields. That functionality would be perfect in the front end, beacause I have the same 2 fields duplicating over and over.

    You are basically doing it in the dashboard. When I click Custom Field twice, this code gets added to the html:

    <li class="selectable gfield" id="field_9">
        <a onclick="DisplayAlert();" href="javascript:void(0);" title="click to delete this field" id="gfield_delete_0" class="field_delete_icon">Delete</a>
        <a title="click to edit this field" href="javascript:void(0);" class="field_edit_icon edit_icon_collapsed">Edit</a>
        <label for="input_9" class="gfield_label">Post Custom Field<span class="gfield_required"></span></label>
        <div class="ginput_container">
            <input type="text" disabled="disabled" tabindex="1" class="medium" value="" id="input_9" name="input_9">
        </div>
        <div class="gfield_description"></div>
    </li>
    <li class="selectable gfield" id="field_10">
        <a onclick="DisplayAlert();" href="javascript:void(0);" title="click to delete this field" id="gfield_delete_0" class="field_delete_icon">Delete</a>
        <a title="click to edit this field" href="javascript:void(0);" class="field_edit_icon edit_icon_collapsed">Edit</a>
        <label for="input_10" class="gfield_label">Post Custom Field<span class="gfield_required"></span></label>
        <div class="ginput_container">
            <input type="text" disabled="disabled" tabindex="1" class="medium" value="" id="input_10" name="input_10">
        </div>
        <div class="gfield_description"></div>
    </li>

    Then I hit Update Form and all that gets added to the database by the magic of tiny NInjas or however you're doing it. All I know is that is pretty cool.

    So, on the public side, if the Custom Field button could be the "Add New Label" button, and add this code to my html...

    <li class="gfield" id="field_8_1">
        <div id="input_8_1" class="ginput_complex ginput_container">
            <span class="ginput_left" id="input_8_1_3_container">
                <input type="text" tabindex="1" value="" id="input_8_1.3" name="input_1.3">
            </span>
            <span class="ginput_right" id="input_8_1_6_container">
                <input type="text" tabindex="2" value="" id="input_8_1.6" name="input_1.6">
            </span>
        </div>
    </li>

    then pressing it again would add this...

    <li class="gfield" id="field_8_2">
        <div id="input_8_2" class="ginput_complex ginput_container">
            <span class="ginput_left" id="input_8_2_3_container">
                <input type="text" tabindex="3" value="" id="input_8_2.3" name="input_2.3">
            </span>
            <span class="ginput_right" id="input_8_1_6_container">
                <input type="text" tabindex="4" value="" id="input_8_2.6" name="input_2.6">
            </span>
        </div>
    </li>

    and the Update Form button could be the "Submit Post" button and do all the magic your backend form is doing, wow. That would be awesome.

    I mean it's awesome now, but that would make it ...awesome..er.

    Posted 3 years ago on Friday December 17, 2010 | Permalink
  4. So you are wanting to do an 'if..else' or case approach.

    At the moment the only way to do this is create multiple forms and display only the form that matches the conditions via template tags. (short code if you have the post php plugin)

    Otherwise you basically need to toss GF out the door and make your own custom plugin. You can do all this pretty easily if you don't want all the fancy form generation drag and drop that GF offers. Other then support, that's basically what you are paying for on the basic GF plugin.

    If you are very courageous you could always hack gravity forms and add in a custom action that modifies the form based on criteria set, and then add that as a template tag or wherever you want to make use of it.

    By the way...making a drag and drop form creator with the ease of use and style GF has would cost you hours of your time. GF costs you $40.00. How much is your time worth?

    Posted 3 years ago on Friday December 17, 2010 | Permalink
  5. We do plan on adding the ability to have dynamically duplicating fields in a future release. It is a feature we plan on adding. We have to get through the current development cycle before we can focus on additional features.

    Posted 3 years ago on Friday December 17, 2010 | Permalink
  6. supplyguy
    Member

    Thanks urmedia for your response and thank you Carl for yours. Good luck Carl and everyone with the development. You're onto something great here.

    Posted 3 years ago on Friday December 17, 2010 | Permalink
  7. I want to add my feature request to this list. I would LOVE this.

    Posted 3 years ago on Wednesday April 13, 2011 | Permalink
  8. How can the administrator add an entry directly from the dashboard?

    Posted 2 years ago on Tuesday July 3, 2012 | Permalink
  9. The administrator cannot add entries from the back end. You can use the form preview and submit the form that way. But you have to submit the form somehow to record an entry.

    This question is unrelated to the original topic. Please begin a new topic for your issue if you need more assistance. Thank you.

    Posted 2 years ago on Tuesday July 3, 2012 | Permalink

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

Support Tickets

 Open A New Support Ticket

 Open A New Priority Support Ticket *

* Developer license holders only