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.

Submitting a Form Entry via PHP / AJAX embed in other process

  1. ChrisF
    Member

    Hey,

    Following idea:

    I want to submit a form entry for a gform during a custom registration process of a theme (templatic StoreBox: http://templatic.com/ecommerce-themes/storebox). Background is a small poll which should be filled out during the registration process while sending the information to the database, but not directly to the user meta.

    I cannot use the user registration functions of gravity forms because the registration process of the theme has to be used.

    I am using the newest gravity forms version (1.5.2.8)

    I thought about two ways but couldn't succeed for now:

    1) embedding the form via gravity_form() with ajax support, disabling the submit button, firing the event when registration button clicked

    what i did:

    in the template file:
    <?php gravity_form(1, false, false, false, '', true) ?>
    in functions.php:
    gravity_form_enqueue_scripts(1, true);

    But the ajax functionality seems to not work, any idea why? couldn't find a hint in the source code, because i used the same form via shortcode in a post and it worked with ajax. i looked through the html code of both pages and couldn't find missing js or anything...

    Anyways I also had another solution in mind:

    2) Building the Form fields of the poll in the registration form and submitting it, then in the postprocessing create a form object and submitting it invisible.

    Idea:

    $form = new Form (...form data from post values...)
    $form->submit();

    or

    gforms_submit_form(...form data from post values..);

    But i couldn't figure out how to make this work... is this possible? couldn' find a hint in the forum / docs.

    If not it would be a feature request to send Form submitions just via a function call without using an actual html form.

    thanks a lot for your help!

    Posted 12 years ago on Tuesday August 9, 2011 | Permalink
  2. Hi Chris,

    A few questions:

    1. Is the entire registration form a Gravity Form or only the poll portion?
    2. Could you send me a direct link where I could preview the registration form?

    I'm still a little confused as to what the end goal is, but I perhaps seeing the form itself will help clear things up. :)

    Posted 12 years ago on Tuesday August 9, 2011 | Permalink
  3. ChrisF
    Member

    Hey David,

    thanks for your reply.

    Meanwhile we decided to not use Gravityforms in this case because it's faster just to implement the poll in the registration process.

    Anyways a nice feature would be the possibility to inject form entries just via a function:

    gforms_submit_form( $form_id, $form_values);

    is this feature existing? if not i can write a feature request for it.

    Else I think the topic can be closed if possible.

    Regards, Oli

    Posted 12 years ago on Wednesday August 10, 2011 | Permalink
  4. Currently there isn't a function that can be used to submit entries for a form using a function call, currently the only way to create is an entry is by submitting a form or via custom code that you would have to write to insert the data in the correct format.

    Posted 12 years ago on Wednesday August 10, 2011 | Permalink

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