• Resolved fasil878

    (@fasil878)


    its helpfull. but anyways to add this is in when a user form submit? or after from sbmit redirection. pls help me. a bit urgent

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter fasil878

    (@fasil878)

    i mean i need to get thsi as suers unique id or refer

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @fasil878,

    Trust you are doing good and thank you for reaching out to us.

    Every user created in WordPress has a unique user ID, which you can configure as the default value of a Hidden Field in Forminator form.

    Please check the following screenshot: https://ibb.co/M5kDcbZ

    I hope that helps.

    Kind Regards,
    Nebu John

    Thread Starter fasil878

    (@fasil878)

    i know that. But any option to see it without hidden filed

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @fasil878

    I pinged our SLS team to review your query and see what will be possible in this case. Thank you for your patience while we look into this further.

    Kind Regards,
    Kris

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi again @fasil878

    This task has been flagged for our SLS Team so that they can see what will be possible for you. Please keep in mind that our SLS Team deals with more complicated issues, so it may take a little longer before we will reply with solution.

    Kind Regards,
    Kris

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @fasil878,

    Could you please try this snippet and see whether it helps?

    <?php
    
    add_filter( 'forminator_form_submit_response', 'wpmudev_add_reponse_query_param' , 20, 2 );
    add_filter( 'forminator_form_ajax_submit_response', 'wpmudev_add_reponse_query_param' , 20, 2 );
    function wpmudev_add_reponse_query_param( $response, $form_id ) {
        if ( $form_id != 6 ) { //Please change the form ID
            return $response;
        }
    
        $prefix = 'REG2022_';
        $incremental = get_option( $form_id.'_autoincrement_int' );
    
        if ( $incremental ) {
            //remove prefix:
            $incremental = str_replace( $prefix, '', $incremental );
            $incremental = (int)$incremental;
        }
    
        if ( ! $incremental ) {
            $incremental = 1;
        } else {
            $incremental = $incremental + 1;
        }
       
        update_option( $form_id.'_autoincrement_int', $prefix.$incremental );
    
        $response['url'] = str_replace( '{random_digit}', $prefix.$incremental, $response['url'] );
        return $response;
    }

    You’ll have to update the following line with your form ID:

    if ( $form_id != 6 ) {

    Support the from ID is 123, then the above line will change to:

    if ( $form_id != 123 ) {

    Also, please make sure the redirect URL added has the following {random_digit} to print the random digit.

    You can implement the given code as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Best Regards,

    Nithin

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @fasil878 ,

    We haven’t heard from you for 4 days now, so it looks like there are no more questions for us.
    ?
    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Serial Number or Auto increment number field’ is closed to new replies.