Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Formular sent method and JavaScript validate


I am using Metronic 8.2.0 and the sign-up template from demo25 (fancy one).

I want to sent the input data from email and password to my php file where it’s getting checked with the database if email already exists or not. If yes the user should get a modal that he must choose another. If okay the script should open a modal inform about that registration is complete and after clicking goto next page.

I have checked the generaljs from the auth. JavaScript example where all Formular client side error handling will be done.

I am a bit lost how I can realize what I intend to do. Can you give a hint how to realize that?


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi,

If you are using the latest Metronic 8.x version you can refer to src/js/custom/authentication/sign-in/general.js and enable handleSubmitAjax functions instead of handleSubmitDemo in line number 212 and you can slightly modify handleSubmitAjax code
The error messages you can display with SweetAlert plugin as it's a more user-friendly and practical way.

Your server-side code should return some JSON data based on what you can show in the error message.

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(