0

I am working on a form (Gravity Form) which needs some user authentication when the form is submitted. Gravity's documentation pointed out the place where i should place my code. i.e.

gform_pre_submission_filter

I tried using SimpleModal Login, but problem comes when the user is authenticated and it is redirected either to the dashboard (default) or using redirect_to. This causes all fields reset to defaults.

Question is how can i preserve my form's (gravity form) entries and still authenticate and login the user?

1 Answer 1

1

As per the Plugin FAQ use,

wp_loginout($_SERVER['REQUEST_URI']);

Sorry that's entirely incorrect, that function prints out the login/out url which you do not need/want for the purpose of using within a filter, instead use,

wp_redirect( $_SERVER['REQUEST_URI'] );

...to return the user to the page they were on.

If that does not allow you to preserve the form field values during the pre submission filter then you might need to pass the form values into the filter and return them. Surely GF would handle this for you.

Let me know.

2
  • surely wp_redirect( $_SERVER['REQUEST_URI'] ); will loose all the form field values. now, can you elaborate (an example will be appreciated) "you might need to pass the form values into the filter and return them" statement Commented Sep 11, 2012 at 18:02
  • any help will be appreciated Commented Sep 13, 2012 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.