Notification, "Registration Done" message Displayed by clicking on a form button?

Asked

Viewed 2,214 times

-1

How to get the browser, or actually the site to send messages like those issued for you to subscribe to a newsletter from some site. I want this message to appear when I click the sign-up button...

  • Hello, posted the simplest way to do, if you want something more customized, put, for example, what exact message you want to send to the user and what you want to do after displaying the message.

1 answer

5

This is the standard method of sending messages via Javascript:

function msg() {
  alert("Botão Clicado!");
}
<button onclick="msg()">Teste</button>

And here I am mounting a simple Modal call via Javascript/jQuery:

function msg() {
  $("#mensagem").addClass('ver');
  setTimeout(function() {$("#mensagem").removeClass('ver'); }, 3000);
}
#mensagem {
  transition: all 0.52s;
  background: #FFF;
  border: #777 solid 1px;
  box-shadow: 1px 1px 5px rgba(0,0,0,.52);
  position: fixed;
  top: -150px;
  width: 50%;
  padding: 25px 0;
  text-align: center;
  left: 25%;
  opacity: 0;
}

#mensagem.ver {
  top: 75px;
  opacity: 1;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<button onclick="msg()">Teste</button>

<div id="mensagem">Muito Obrigado por sua Mensagem!</div>

  • Thiago Santos, this is exactly the solution I needed! Thank you!

  • @A.A.Marco scores as solved then man. Hug

  • @A.A.Marco please mark the response as resolved so that other users can also be helped

Browser other questions tagged

You are not signed in. Login or sign up in order to post.