0

I have a form in my website for sending a rate which is accessible by everyone.

So before submitting the form, a popup is opened asking for login.

There are two cases:

  • A rate is sent anonymously without authentication or

  • the user login before sending the rate.

My question is :

How can I still on the same page and conserve the selected data after the login process and then send the rate.

Thank you.

amer
  • 1,270
  • 12
  • 20
alia
  • 19
  • 4

1 Answers1

-1

You can you AJAX for this.

Here is how you can post the form through AJAX using jQuery.

Shahzad
  • 1,673
  • 1
  • 12
  • 20
  • 3
    This could have been posted as a comment since it doesn't add any new information from the linked SO answer. – lealceldeiro Dec 30 '19 at 15:39
  • The pb is that there is the spring security. In the second case, I have two forms to submit. The login form and the form for sending the rate – alia Dec 30 '19 at 16:22
  • @alia When you have to submit 2 forms, you first send an AJAX request for the login and on the success callback of that, you can send the rate form through AJAX again – Shahzad Dec 30 '19 at 16:27