Alert message

2

I'm using the common javascript alert in a field-checking function:

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

But I'd like something nicer, some custom text box to display the message.

    
asked by anonymous 09.11.2015 / 18:14

1 answer

0

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

<!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 website: link

    
09.11.2015 / 18:25