Invalid request. Please try again
Support › MB Frontend Submission › Invalid request. Please try againResolved
- This topic has 3 replies, 2 voices, and was last updated 4 years ago by
Long Nguyen.
-
AuthorPosts
-
April 13, 2021 at 5:04 AM #27192
Wolfgang
ParticipantHey there,
I am trying to create a custom ticket system for my customers. I've set up a cpt called ticket and want to create a frontend form for updating the tickets.
I have created a custom dashboard which shows all the "tickets". I've also followed your tutorial on dynamic population. So my link looks like the following now: example.com/frontend-submission/?rwmb_frontend_field_post_id=46. frontend-submission is the page where I have implemented the following code:$form = '[mb_frontend_form id="tickets" post_type="ticket" post_fields="title" edit="true" allow_delete="true"]'; echo do_shortcode( $form );
So far everything works fine the form is filled with the correct data and I can also change everything I want! But when I want to update the post I get an error message, it also appears when I try to submit a new post.
It always keeps telling me "Invalid request. Please try again". Did you ever face that problem before? What could cause this?Thanks in Advance for your help!
April 13, 2021 at 6:25 AM #27196Long Nguyen
ModeratorHi,
Thank you for reaching out.
Can you please share some screenshots (whole screen) of this issue? Where did you embed the code to show Frontend form and Frontend Dashboard?
Please try to use the shortcode in the documentation on two pages and see if it works.
https://docs.metabox.io/extensions/mb-frontend-submission/April 13, 2021 at 2:17 PM #27203Wolfgang
ParticipantHi
thanks for your reply. I think I found the problem even though I don't understand it yet.
I have a php function which creates my custom link in the dashboard which is<?php function clink() { $post = get_post(); $link = "https://my-link.at/form-submission/?rwmb_frontend_field_post_id=" . $post->ID; return $link; } ?>
I am using the "advanced scripts" plugin for php codes since I am using Oxygen and the functions.php is not available. For my understanding the function shouldn't do anything without calling it, right? But the weird thing is, when I set conditions where this .php file should be executed I can use the mbform to update my post.
https://share.getcloudapp.com/E0uYrpXD
I've set it to only work on my "dashboard" page.My Dashboard page is a custom made page, so I didn't use the "Frontend Dashboard" which is provided by metabox:
https://share.getcloudapp.com/P8u5yowz
The button below gets the custom link value as seen in the first share (from the script). That's also the place where I call the function.After clicking on the button i will be redirected to my page ../form-submission/?rwmb_frontend_field_post_id=46 where ID is dynamically added.
https://share.getcloudapp.com/DOuD9Z7ASo now, since I've set that condition for the script everything works fine, but maybe you can help me understand why I need to set a condition for that script as it shouldn't be executed anyway? Or am I missing something? (not a coder at all :-D)
Thanks again for your help
April 13, 2021 at 9:33 PM #27213Long Nguyen
ModeratorHi,
I'm not sure how Oxygen executes functions on their side. But glad to see it works.
-
AuthorPosts
- You must be logged in to reply to this topic.