Urja

Untitled

Jul 14th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>A doc.</title>
  6. </head>
  7. <?php
  8.  
  9. include_once 'database.php';
  10. $db = new Database();
  11. $token = $db->getRegisteredToken();
  12. echo $token;
  13. ?>
  14. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  15. <script>
  16. $( document ).ready(function($) {
  17. $(".t-form").submit(function(e){
  18. alert($("#ta").val());
  19. e.preventDefault();
  20. });
  21. });
  22.  
  23. function isEmptyTextBox(){
  24.  
  25. var msgLength = $.trim($(“textarea”).val()).length;
  26.  
  27. if(msgLength == 0){
  28.  
  29. alert(“Text box must not be empty”);
  30.  
  31. return false;
  32.  
  33. }else{
  34.  
  35. return true;
  36.  
  37. }
  38.  
  39. }
  40. </script>
  41. <body>
  42. <form class="t-form" method="post" action="Servertofirebase.php" onsubmit="isEmptyTextBox()">
  43. <textarea name="tarea" id="ta" cols="30" rows="10"></textarea>
  44. <input id="button-send" type="submit" value="Send Firebase Push Notification">
  45. </form>
  46. </body>
  47. </html>
Add Comment
Please, Sign In to add comment