Load data saved in form on a new form - forms

I need to use Orbeon Forms to create a form to capture the price from a number of things. I create a form, connect it with database (MySQL), deploy the form, complete the form, and it saves the data correctly in database.
Then my question is: if I complete form_1 and save the data in the database, and later enter to the empty form_1:
Is it possible to load the data entered previously or from the last form completion for form_1?
Is it necessary to have button or any control to take an action?

When you load a page to fill a new form, notice how the URL ends with /new. When you are on that page, and save, notice how the URL changes to /edit/123 (where 123 is a long unique identifier). You can come back to edit the data by loading again this URL.
In practice, this is often done by going to the /summary page for the form, and clicking on the relevant form data you want to edit.

Related

HTML form in 2 pages and submit on second page - how to achieve?

I have 2 jsp pages with forms and in first jsp page, once the user fill the form then they will click on 'continue' button and in the second page they have to enter data for few more form fields and do submit. once they do submit then data from 1st jsp and 2nd jsp need to be updated to backend. My question how i can submit the form in second page with first page data included
Store the user input from the first form in <input type="hidden"> in the second form. If there are are file inputs, then you'll need to store the file on the server and include some kind of reference (like a unique id or a URL) in the input.
Alternatively, you could use a session (but that risks a race condition if the user fills in two copies of the form at the same time across multiple tabs in their browser).
Alternatively, you could store the data in its final destination (e.g. a database table) with a flag on it marking it as a draft. Then update it with the rest of the data and remove the flag when the second form is submitted.

iTextSharp edit generated PDF and save back to database

I have process that I want to do that I'm not sure it is possible. I am using iTextSharp to generate and populate a PDF with collected data that a user has entered in a previous screen.
Then the PDF is saved to a SQL Server Database as binary data. Then it is pulled back for the user to view in the browser if they would like too.
It is possible to generate the PDF, do not flatten the form, and then allow the user to edit areas that may have not been prefilled by the users information. Then I will need to be able to save this back to the database.
I have some findings on using a adobe submit button that submits the pdf to a URL that would collect the data, but I want to know if iTextSharp is capable of this. Using ASP.NET or another example.
I do not want to save the form field information, but save the whole pdf to the database with some sort of submit button.

Symfony2 - Showing a page for a user to confirm input form values

I have a long form that an user has to fill. After the user has clicked submit, I have to show a page with the information the user has filled in the form so that he can check that everything is correct before doing any further processing (i.e., he has to press another submit button or a back button if he detects an error).
Is there an easy way to do this? Is there a better way than creating a new form with hidden values equal to the values submitted in the previous form?
Would it be okay if I just store the information in a session variable and then process it if the user confirms?
You could skin that cat many ways, here's a couple of ideas:
Add a non-mapped confirm input (like a checkbox) to your form. On initial form render with no POST, hide the input. When you get a POST, show the checkbox input & some additional information (please review your data & check to confirm all is OK etc). Don't validate the form or save your data until the confirm input has been checked. You don't need to mess about with hidden fields, the one form will do the job for you.
Save the entity and give it a property e.g. isApproved, that way you can show the data easily & if the user needs to edit, re-use your form. When the user approves the information set isApproved to true. Don't perform any actions on any entities that have isApproved == false. Cons are you then have to manage an isApproved state for an entity.

Blue Imps jQuery file upload send files with form like normal field

Is it possible to send file with form as normal file upload? When I check a file field it is always empty, and I need to send it with form data in one call. IS that possible?
There might be better answers out there, but I ended up solving this by following steps.
Having 2 forms on the page. One for file upload and one for other form data.
Format both forms using CSS so that user gets look and feel of one form.
Have only one div (which looks like button) to submit. Hide the actual form's submit button, if you are using them (I don't. Because I preprocess data and then send by ajax)
Once user submits forms (by clicking the dummy button), Using JS programatically click the file upload button.
Optional Once that call is finished, if there are no errors only then continue.
Submit the form with other form data.
The advantage I had in this approach was that I could have more control over user's form data as well as my file upload's settings. Because I had some settings (like max number of files and max file size) were dependent on user's form entry.

Form Repopulation on Redirect using ASP

I'm currently working on an application that uses ASP, and I am currently having difficulty repopulating the fields of a form after redirecting back to that form.
Basically, I have a form where a user can input data into it (Say, an admin creating a new user within the system). Upon clicking the "Submit" button on the form, it goes to a processing page (say, userproc.asp) where it does input validation and adds the user to the database.
My issue is when the input validation fails, the application needs to return the user to the Form, report the issue, and keep the form populated as it was before clicking on submit.
This is where my problem lies, as I cannot find a good way to get a form to repopulate properly upon redirecting back to it using ASP. We do not want to use Javascript either.
Any thoughts/suggestions?
Make the Action for the Form point to itself instead of to a different "processing" page.
Remove the "processing" code that performs the validation and "user creation" for the "processing" page and place it in a Class defined in a new ASP page. This page is code only (just contains this class).
Include the new Class asp file in the orginal form page. On receiving a post instantiate the class and call an "Process" method where all your original code will work.
Have the method return some indication of success. If it has succeeded now you could either redirect to a "success page" or simply include the success markup in the form page. If the processing is failed you return your original form with the addition that you can set the values for all the fields to the ones received.