javascript login validation
<html>
<body>
<form id="form1" runat="server">
<div class="container">
<div class="main">
<h2>
Javascript Login Form Validation</h2>
<form id="form_id" method="post" name="myform">
<label>
User Name :</label>
<input type="text" name="username" id="username" />
<br><br>
<label>
Password :</label>
<input type="password" name="password" id="password" />
<input type="button" value="Login" id="submit" onclick="validate();" />
</form>
</div>
</div>
</form>
</html>
</body><script language = "JavaScript">
function validate() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username == null || username == "") {
alert("Please enter the username.");
return false;
}
if (password == null || password == "") {
alert("Please enter the password.");
return false;
}
alert('Login successful');
}
</script>
Also in JavaScript:
- mongoose
- javascript create svg
- js array.splice first element
- js get mic level
- input not detecting text
- js array delete last
- js convert obj to array
- replace array element javascript stack overflow
- how to create a javascript hello world program with node.js
- localstorage javascript
- remove the items in array which are present in another javascript
- how to use javascript to get full file path
- ngswitchcase in angular 8
- three js get size of object
- get uislider
- how to remove last element in js
- javascript sort array of ints
- what is ... in javascript
- export multiple functions react
- Better Array check with Array.isArray Because arrays are not true array in JavaScript, there is no simple typeof check. No problem! Use the method Array.isArray to check…
- postgresql json array contains
- react hooks update nested object
- pass variable to regrex literal notation javascript
- how to use a js class in react