How to make forms which users can add | Django

I want to make something like google forms which users can make themselfs. I want just simple html string forms which can reveal answer and check is it right instantly. No matter how users will create forms, but only using webpage. Without additional connecton to DB. Using only one field in column in DB.

Maybe forms can be like this using just html (best variation)

One way to do this would be to use JavaScript to create the form elements dynamically on the page and then use JavaScript to check the answers and reveal the results instantly. You could also use HTML form elements and use JavaScript to handle the form submission and check the answers.

You mentioned you do not want to connect to a database, so the forms and answers would need to be stored in the browser's local storage or a cookie. This would mean that the forms and answers would only be accessible on the same device and browser that they were created on.

It's a good idea to use some JavaScript library like jQuery, Vue.js or React.js that will help you to handle forms and check answers without writing a lot of code.

It's also good idea to use some CSS framework like Bootstrap, Foundation or Bulma to make your forms look more professional.

Edit: To achieve this, you could use JavaScript to create the forms dynamically on the page and use JavaScript to handle the form submission. When a user submits a form, you would use JavaScript to serialize the form data and store it as a string in the single field in the database.

You could also use JavaScript to retrieve the stored form data from the single field in the database, and use it to dynamically create the forms on the page.

You would also need to use JavaScript to check the answers and reveal the results instantly. Since the forms and answers are stored in a single field in the database, you would need to use JavaScript to parse the stored data and check the answers.

Edit 2: Yes, you can pre-set answers in HTML. One way to do this would be to use JavaScript to dynamically create the form elements and pre-populate them with the pre-set answers. For example, you could create a JavaScript object that contains the pre-set answers, and then use JavaScript to populate the form elements with the values from the object.

You can also add a check button next to the form elements. When the user clicks the check button, you could use JavaScript to check if the user's answers match the pre-set answers. You can show the result instantly to the user by displaying a message or changing the color of the form element.

Back to Top