• Resolved robthirlby

    (@robthirlby)


    Using pods 2.3.18. I can create a small pods form in php in a pods page by

    <?php
     $mypod = pods( 'user_form' );
    // Only show custom fields
    $fields = array( 'username', 'email' );
    echo $mypod->form( $fields, 'goSubmit', 'productions/' );
    ?>

    and this works exactly as expected. The pod is table stored. A new row is created and it returns to the specified URL.

    However the equivalent code using pods embed in a post produces
    [pods name="user_form" form="1" fields="username, email" thank-you="productions/"] works ok except that the URL is not honoured, the standard success message is output and the form repeats ad infinitum. each time creating a row in the table.
    Is this a bug or am I misusing the embed facility?

Viewing 4 replies - 1 through 4 (of 4 total)
  • It’s thank_you, not thank-you for the shortcode attribute in this case.

    I’ll patch our code on our side, the shortcode builder in the plugin has it wrong ??

    Thread Starter robthirlby

    (@robthirlby)

    Thanks Scott. I patched my plugin to change the – to a _
    i.e.

    if ( thank_you.length )
                        shortcode += ' thank_you="' + thank_you + '"';

    and it worked but
    [pods name="author" form="1" fields="first_name,last_name,description" label="lookup author" thank_you='/formpage/?new_id=X_ID_X']

    caused the URL to be passed as
    https://localhost/formpage/?%3Ccode%3Enew_id=647%3C/code%3E

    and [pods name="author" form="1" fields="first_name,last_name,description" label="lookup author" thank_you="/formpage/?fill=fill&new_id=X_ID_X&full=full"]
    produced

    https://localhost/formpage/?fill=fill%3Ccode%3E&new_id=651&full=full%3C/code%3E

    Regards,
    Rob

    You should try to copy/paste the shortcode in the ‘Text’ view of the editor, it’s possible your copy/paste into the shortcode resulted in an issue with some extra HTML slipping into it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘pods::forms via embed facility in post’ is closed to new replies.