How to save dynamic form to database / edit form back - javascript

I've made myself a dynamic form builder using jquery ui that the the user can drag form inputs to wherever they like on the screen and create a report. Now I'm looking to save this to a SQL database. What would be the best way in going about saving the layout of this form and creating a database table from it that the user can then fill in reports and submit them to the database.
How would I go about saving the HTML elements styles like transformations etc. I'd need these as I would like to be able to take an existing form and recreate it if it needs anything to be added/removed.
Would appreciate any suggestions.

How about arrange its fields and data into XML format or JSON then save it to database. You can use XML datatype column for XML format and varchar for JSON in Database.

Related

Standard way to implement data input table's frontend for Django

I need to build a website with the following types of data input table.
I want to use html, css, js and bootstrap for the frontend and Django for the backend and SQLite also as Django's default database system. Now I am confused about what is the standard way to implement this type of input table's frontend. I can generally implement a table and inside the cell(means inside <td> tag) I can put another <input> tag to take input data and send it in the database from the user). Or I can use an editable table (Actually I do not know if it is possible to use this type of editable table to send data in the database or not).
Here I need an add row button and delete row icon also like the picture to add/remove the input row if needed, and I don't know how to implement it also thus it will easily reachable from the backend.
So please suggest to me what is the best way and how I should implement this frontend thus I won't be trouble to implement this website's backend also.
You can think of saving the table cell data to the backend on blur.
For this you might need to post data without submitting the form.
You can create an invisible form and submit the edited cell data of the form on every blur with row and column value to backend. You can trigger the submission of form programmatically and doing a prevent default to avoid page redirect.
On loading of the page you can get the whole data and use the framework to create table.

Insert the selected data from the grid into SQL Server database

I am trying to create a website using Django, python and sql server which lists out the items in a tabular form. And upon selection of particular item via check box i want to update my database table with selected items.
For eg: in the image below if ID : n1234 is selected i want to update backend table with drugsdispensed
I am trying to learn Django and Python.
HTML File :
loop through the object and save it in the database :
I know there is a better of doing the same thing looking for comments

How to create a grade table data from excel data to html display?

I need to create a data table of score, in with it with show score of participant, taking data from excel to html display with an ID input and only show individual participant score with the correct ID. Any Idea for starter, or any site that provide a online form of sure kind.
Like this
Is it static data or does it change programatically? For static files I've had success converting to CSV and using this tool to output JSON which I use to generate the HTML.

How to acquire data from users online?

I prepare to perform a simple project and I don’t know what I should use to accomplish this. I need to receive a data entered by a user (via a webpage) and store them somewhere. I need them to be able to search and returned on the user request. I’m a little old-fashioned so I assumed that should be a file on ftp managed by some python or JS script? I really don’t know where to start so please advise.
project
Have you considered storing data in a database?
You can use MySQL. It's quite simple after you understand how a database table works.
Data are stored in a table. Table is a part of a database with other tables.
Each table has columns you create. Data are added to the table in rows.
For example, let's say a user sends you their name 'Brian'.
You can have a table called 'users'. In that table, you can create a column 'id' of the user (read about it later, including auto incrementing), and 'name'.
You insert the data into that table. Brian is now in a table with his own ID, like this:
id Name
----------------
1 Brian
Check this out:
SQL tutorial
Possible solution i would recommend:
create a mysql server
create a backend (links for Java)
rest-service https://spring.io/guides/gs/rest-service/
access DB https://docs.spring.io/spring-data/jpa/docs/1.5.0.RELEASE/reference/html/repositories.html
put the parts together
get/save the data on your webpage with xhr2.

CSV File Editor

I need to create a CSV File editor. The user should be able to upload a CSV file, and the data should automatically be loaded into a text area. I have seen many examples of CSV data being transferred from a text area to, for example, a table, but I can't find something that will help me with actually uploading a file, reading the data from it in to a 2D array, and then placing it in a text area.
I can transfer the data into an editable table from the text area without problem.
So the question is: How can I upload a file, read the data from it (and keep the format of the CSV) and display the correct format in a text area element?
I am not currently concerned about checking to see if the CSV is correct etc etc. I just need to know how to handle the data. Sorry, but my Ajax knowledge is very limited. Any help or guidance would be appreciated.
Uploading it is no different than how any other form works in HTML.
You can use a file input to select a file, then upload it as part of the form data (it's automatic) or supply the user with a textarea to paste into. Submitting the form will "upload" the data to the server. You don't need AJAX to do any of this, but it is an option.
What you do with the data on the server is up to you.

Categories