Is there a way I can store form information using javascript and jquery to the variable first and only when user hits submit button, save that data, else discard it.
I know html forms do the same, but I have an example where I can add multiple content using same input field and when user clicks add button content is sent to controller via ajax and manipulated then inserted in database and displayed from database entry instantly. But I don't want to save that data to database beforehand, only when complete form is submitted.
So I want to save that data to some array first not directly to database, display it and save it to database only when user clicks submit button and sends the entire form to the server.