Home javascript Submitting form data to JS mail

Submitting form data to JS mail

Author

Date

Category

Hello, I have two forms

& lt; form class = "order-form" method = "post" & gt;
     & lt; p & gt;
      & lt; label class = "visibility-hidden" for = "name-field-one" & gt; Your name & lt; / label & gt;
      & lt; input type = "text" name = "name" id = "name-field-one" placeholder = "Name" required & gt;
     & lt; / p & gt;
     & lt; p & gt;
      & lt; label class = "visibility-hidden" & gt; Your phone & lt; / label & gt;
      & lt; input type = "text" name = "number" id = "number-field-one" placeholder = "Phone" required & gt;
     & lt; / p & gt;
     & lt; p & gt;
      & lt; label class = "visibility-hidden" & gt; Your email & lt; / label & gt;
      & lt; input type = "email" name = "email" id = "email-field-one" placeholder = "Email" & gt;
     & lt; / p & gt;
     & lt; p & gt;
      & lt; button class = "order-button" type = "submit" & gt; Submit & lt; / button & gt;
     & lt; / p & gt;
    & lt; / form & gt;

and

& lt; form class = "modal-form" method = "post" & gt;
     & lt; p & gt;
      & lt; label class = "visibility-hidden" for = "name-field-two" & gt; Your name & lt; / label & gt;
      & lt; input type = "text" name = "name" id = "name-field-two" placeholder = "Name" required & gt;
     & lt; / p & gt;
     & lt; p & gt;
      & lt; label class = "visibility-hidden" & gt; Your phone & lt; / label & gt;
      & lt; input type = "text" name = "number" id = "number-field-two" placeholder = "Phone" required & gt;
     & lt; / p & gt;
     & lt; p & gt;
      & lt; label class = "visibility-hidden" & gt; Your email & lt; / label & gt;
      & lt; input type = "email" name = "email" id = "email-field-two" placeholder = "Email" & gt;
     & lt; / p & gt;
     & lt; p & gt;
      & lt; button class = "order-button modal-btn" type = "submit" & gt; Submit & lt; / button & gt;
     & lt; / p & gt;
    & lt; / form & gt;

It is necessary that the data from the form be sent to the mail, I saw the implementation of this task in php, the question is, is it possible to do this in pure js or jquery and will this be the right solution? If so, how? Please tell me.

For the “Submit” button in the first form in js I have preventDefault, will this affect the submission of data?


Answer 1

Found this plugin on Google jquery.textmistake . An article on habrahabr . At the same time, you do not write code on the server, the plugin will do everything by itself, I think you will figure it out.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions