I have 2 fileds Name and Password
i need 2 types of validations in single form
1)need to display particular error message at particlar field if field is empty
2)after clicking of sumit button if form is valid then dispaly form valid
then dispaly relevant error messages ar relevant fields
could you please help me
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
Name:<input type="text" id="Name" name="Name" required />
<span id="Name1" style="font-size: 15px; font-weight: bold;">
Name is Required .
</span>
<br />
Password:<input type="text" id="Password" name="Password" required />
<span id="Password1" style="font-size: 15px; font-weight: bold;">
Password is required.
</span>
<input value="submit" name="Sumit" />
<script>
$('button').on('click', function () {
});
</script>
</body>
</html>