Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>A doc.</title>
- </head>
- <?php
- include_once 'database.php';
- $db = new Database();
- $token = $db->getRegisteredToken();
- echo $token;
- ?>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
- <script>
- $( document ).ready(function($) {
- $(".t-form").submit(function(e){
- alert($("#ta").val());
- e.preventDefault();
- });
- });
- function isEmptyTextBox(){
- var msgLength = $.trim($(“textarea”).val()).length;
- if(msgLength == 0){
- alert(“Text box must not be empty”);
- return false;
- }else{
- return true;
- }
- }
- </script>
- <body>
- <form class="t-form" method="post" action="Servertofirebase.php" onsubmit="isEmptyTextBox()">
- <textarea name="tarea" id="ta" cols="30" rows="10"></textarea>
- <input id="button-send" type="submit" value="Send Firebase Push Notification">
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment