JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://jquery.bassistance.de/validate/jquery.validate.js"></script>
<html>
<head>
<!-- Include meta tag to ensure proper rendering and touch zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Include jQuery Mobile stylesheets -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<!-- Include the jQuery library -->
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<!-- Include the jQuery Mobile library -->
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<div data-role="page" id="pageone">
<div data-role="header">
<h1>WhatsApp Spammer</h1>
</div>
<div data-role="main" class="ui-content">
<form id="form1" method="post" action="test.php" data-ajax="false">
<label for="target">06-nummer van slachtoffer:</label>
<input type="text" name="target" placeholder="31612345678" id="target" data-clear-btn="true">
<label for="nickname">Gebruikersnaam voor bericht:</label>
<input type="text" name="nickname" placeholder="Herman" id="nickname" data-clear-btn="true">
<label for="message">Bericht:</label>
<textarea name="message" id="message" placeholder="Hallo!"></textarea>
<label for="amount">Aantal:</label>
<input type="range" name="amount" id="amount" value="50" min="1" max="100">
<input type="submit" value="Verstuur">
</form>
</div>
</div>
</body>
</html>
JavaScript
$("#form1").submit(function() {
var emptyFields = $(":input.required").filter(function() {
return !$.trim(this.value).length;
});
if (emptyFields.length) {
emptyFields.css("border", "1px solid red");
alert("You must fill all fields!");
return false;
}
});