Support » Plugin: Smart Forms - when you need more than just a contact form » show first form data in the second form

  • ibrahimbow

    (@ibrahimbow)


    I have two forms.. The first one is for name and email.. after the client click submit, we will receive an email and the second form will show up for the client to complete filling the form and then submit then we will receive another email.

    The problem is :
    – The first form doesn’t connected with second form
    – we receive two email not connected to each other

    My question is :
    Is there a way that I can show the client information in the second form and also showen in the last email?

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • ibrahimbow

    (@ibrahimbow)

    <?php
    /**
    Plugin Name: Form_data_showup

    */

    add_action( ‘wp_ajax_nopriv_get_user_information’,’smartform_ext_get_user_information’);
    add_action( ‘wp_ajax_get_user_information’,’smartform_ext_get_user_information’);

    function smart_forms_show_data(/** @noinspection PhpUnusedParameterInspection */ $attr,$content)
    {

    require_once SMART_FORMS_API;
    $query=new SmartFormsQuery(17);
    $query->AddField(‘rnField87’);
    $query->AddField(‘rnField104’);

    $query->AddCondition(‘_UserId’,’=’,get_current_user_id());

    $result= $query->GetResults();

    echo json_encode(array(

    “name”=>$result[0][‘rnField87’],
    “email”=>$result[0][‘rnField104’]

    ));
    die();

    }

    ————————

    I want the data of rnField87 store on name and so for rnField104
    but the result comes from other places ?? why

    Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    Sorry what do you mean with the result comes from other places? according to the code that you sent it should return the information of the current logged in user.

    ibrahimbow

    (@ibrahimbow)

    its means I have two forms . The first from has textbox with name [rnfield78] when the client fill it by his name .. ok then he click next… in the second form autofilled
    his name in the textbox (rnField250]

    (He fill in textbox his name on the first form .. he will find it in textbox on the second form)

    But what I got it comes form logged in ( thats not what i want)

    That’s it

    Plugin Author EDGARROJAS

    (@edgarrojas)

    So the problem is that the name comes from the user profile and not the previous form that was submitted? and if so, could you send me an screenshot of your formula?

    ibrahimbow

    (@ibrahimbow)

    I don’t know how to send you the screenshot but I found a website that I can share it with you .. Here is the link

    https://ibb.co/XjDjTfy

    Thank you in advanced

    Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    Yup, i think i understood that part but you mentioned that the second form is filling the data with the current loged in user instead of your first form? and is so, could you send me an screenshot of the formula that fills those fields to see if i can catch something that is wrong with it?

    Regards!

    ibrahimbow

    (@ibrahimbow)

    Yes . As you understood (that the second form is filling the data with the current logged in user instead of your first form) that is not what I want!
    I want the first form data (name and email) is filling in the second form automatically when the user click submit on the first form
    here is the screenshot in this link
    https://ibb.co/GMq7FXN
    Thank you

    ibrahimbow

    (@ibrahimbow)

    Empty form 1

    https://ibb.co/7YGLc87

    ibrahimbow

    (@ibrahimbow)

    Empty form 2
    https://ibb.co/zSbvWG9

    ibrahimbow

    (@ibrahimbow)

    I found solution for that :

    1- Send parameter from the first form
    2- In the second form, put the code in Formula Builder of the text

    Here is the code , what you have to do is to put that code in the Formula Builder of text that you want to show up the info from the last form .

    change the name(rnField89) to the id of the field that yon want to show up from the last form

    function getURIParameter(param, asArray) {
    return document.location.search.substring(1).split(‘&’).reduce(function(p,c) {
    var parts = c.split(‘=’, 2).map(function(param) { return decodeURIComponent(param); });
    if(parts.length == 0 || parts[0] != param) return (p instanceof Array) && !asArray ? null : p;
    return asArray ? p.concat(parts.concat(true)[1]) : parts.concat(true)[1];
    }, []);
    }

    return getURIParameter(“rnField89”, true)

    • This reply was modified 11 months ago by ibrahimbow.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘show first form data in the second form’ is closed to new replies.