user input through js
var at = document.getElementById("email").value.indexOf("@");
var age = document.getElementById("age").value;
var fname = document.getElementById("fname").value;
submitOK = "true";
if (fname.length > 10) {
alert("The name may have no more than 10 characters");
submitOK = "false";
}
if (isNaN(age) || age < 1 || age > 100) {
alert("The age must be a number between 1 and 100");
submitOK = "false";
}
if (at == -1) {
alert("Not a valid e-mail!");
submitOK = "false";
}
if (submitOK == "false") {
return false;
}var x = document.getElementById("myText").value;
Also in JavaScript:
- install node js 14
- react player disable download
- javascript console.log
- jquery add input placeholder
- transfer data from one component to another angular
- moment for react
- Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.ts(1219) angular
- cdn react
- .filter js
- mule 4 json to string json
- swap function javascript
- mongoose virtual populate not working
- how to remove warnings in react js console
- new Map() collection in react state
- resize js
- form taglib in jsp
- js async await
- how to create a constant in javascript
- return value from javascript function
- copy to clipboard function javascript
- laravel csrf token ajax post
- unban command discord.js v12
- material css
- Javascript change element class