Get 2024 Templates Mega Bundle!19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets
Get for 99$

Inquiry Regarding Form Data Handling in Signup Template


Dear Metronic Support Team,

I have encountered a situation where I need your guidance to ensure the proper implementation of user authentication in my application.

I am using the signup form template provided in the Metronic theme, and I have successfully integrated it into my Django project. However, I am uncertain about how the form data is being handled, specifically when a user fills out the signup form.

The form in question is configured as follows:

```html
<form class="form w-100" novalidate="novalidate" id="kt_sign_up_form" data-kt-redirect-url="/signin" action="#">
<!-- Form fields go here -->
<button type="submit" id="kt_sign_up_submit" class="btn btn-primary">
Sign Up
</button>
</form>
```

My primary concern is understanding the flow of data once the user submits the form. I am not sure if the data is meant to be sent to a specific Django view or if there is some JavaScript functionality provided by the Metronic theme that handles the form submission.

Here are my specific questions:

1. Does the Metronic theme provide a JavaScript function to handle the signup form submission, or is it expected that the developer implements this functionality?

2. If the form data is handled via JavaScript, could you provide guidance or point me to the relevant documentation on how to configure it to work with a Django backend?

3. If the form data should be sent to a Django view, could you provide an example or best practices on how to set up the form action and handle the form submission in a Django view?

I would greatly appreciate your assistance in clarifying these points, as it will help me ensure that user data is being handled securely and efficiently in my application.

Thank you in advance for your time and support.

Best regards,
Ali


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Ali,

The Metronic theme provides a JavaScript function to handle the signup form submission. In your views.py file, you can find the following line of code:

KTTheme.addJavascriptFile("js/custom/authentication/sign-up/general.js")


This JavaScript file is responsible for handling the simulation of form submission as demo.

If the form data is handled via JavaScript ajax, you can customize the behavior by modifying the general.js file located at the path /django/starterkit/_keenthemes/src/js/custom/authentication/sign-up/general.js. This file contains the JavaScript code that simulates the signup process.

You can remove the javascript file, if you want to handle the form data in a Django view, you can customize the form's action attribute to point to a Django view URL. For example:

<form class="form w-100" novalidate="novalidate" data-kt-redirect-url="/signin" action="{% url "your_django_view_name" %}">


In this case, you would need to create a Django view that handles the form submission. You can access the form data in the Django view and process it as needed.

Remember that if you make modifications to the general.js file, you'll need to rebuild the assets using Gulp as described in the documentation .

I hope this helps clarify how form data is handled in the Metronic signup template in a Django project. If you have more specific questions or need further assistance, please feel free to ask.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(