Multipart/form-data submit through javascript in Play Framework

Knoldus

Normally when we submit any multi-part form in Play Framework that time in the controller have to mention redirection action which  refresh the whole page and it gives an extra load on the network.

It is possible to submit that form with the help of Ajax. It makes easy to submit your form and help to refresh only that particular section where you want to reflect the changes.

1.  We create a multi-part form for uploading the file and some other information.

2. We develop an Ajax call for submitting form we use  FormData. The FormData object lets you compile a set of key/value pairs to send using XMLHttpRequest. It is primarily intended for use in sending form data, but can be used independently from forms in order to transmit keyed data.

When we call that Ajax call than in the FormData we passed the form_ID so…

View original post 125 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s