Skip Navigation

[Resolved] using cred_submit_com , same page prompt

This thread is resolved. Here is a description of the problem and solution.

Problem:

I am exploring possibilities of displaying 'bootstrap alert' after form submiision on the same page.

Solution:

Action hook "cred_submit_complete"

https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete

Hook that allows doing a custom action after post data is saved to database and before doing any other action, like redirection.

It don't fit for your case, in your case, I suggest you try these:

1) disable option "AJAX submission"

2) option "What to show after submitting the form" choose:

Display a message instead of the form...

Then you will be able to customize the success message manually.

Relevant Documentation:

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Akhil 6 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1115756

Hi team.

i am exploring possibilities of displaying ' bootstrap alert ' after form submiision on the same page.

i have this code.

add_action('cred_submit_complete', 'my_success_action',10,2);
function my_success_action($post_id, $form_data)
{
    
    if ($form_data['id']==7343)
    {
        
        echo  '<div class="alert alert-success"> <strong>Success!</strong> </div>' ;
    }
}

i only get this error "There was an error while submitting the form "

pls advice. thanks.

#1116224

Hello,

Action hook "cred_submit_complete"
https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete
Hook that allows doing a custom action after post data is saved to database and before doing any other action, like redirection.

It don't fit for your case, in your case, I suggest you try these:
1) disable option "AJAX submission"
2) option "What to show after submitting the form" choose:
Display a message instead of the form...

Then you will be able to customize the success message manually.

#1116693

My issue is resolved now. Thank you!