Warning message

Asked

Viewed 138 times

2

I am using common javascript Alert in a field check function:

if(document.cadFinan.dataParcel.value == ""){
    alert("O Campo data é obrigatório!");
    return false;
}

But I would like something nicer, some custom text box to show the message.

  • 1

    Take a look at bootstrap. It’s nice and easy to deploy.

  • Here is a list of 10 http://www.sitepoint.com/10-jquery-alert-windows-prompts/ Only choose and use, if you don’t find one you like among the 10, there are 40 more here. http://jquery-plugins.net/tag/alert-box

1 answer

0


You could use jQuery with some plugin, for example I’m using jquery.modal.js:, but there are many plugins available on the internet, and only search by jquery model plugin.

<!DOCTYPE html>
<html>
<head>
</style>
  <script src="jquery.js" type="text/javascript" charset="utf-8"></script>
  <script src="jquery.modal.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>

  <div id="ex1" style="display:none;">
    <p>Thanks for clicking.  That felt good.  <a href="#" rel="modal:close">Close</a> or press ESC</p>
  </div>

  <p><a href="#ex1" rel="modal:open">Open Modal</a></p>

</body>
</html>

This example I took from the plugin’s own site: http://kylefox.ca/jquery-modal/examples/

Browser other questions tagged

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