Hello…. thanks for the coding i will love to know… haw can i do this same thing but with more user and the controll of the tipe of user that is doing the loging… can you help me? thanks
I want to take value from two input and add them and display in other input box… my code is not working !! can u fix the code.. <!DOCTYPE HTML> <html> <head> <title>My javaWebpage</title> <meta charset="utf-8"/> <script type="text/javascript"> function myfunction() { var x=document.["myform"].["number1"].value; var y=document.["myform"].["number2"].value;
var total=x + y; document.getElementById("ans1").innerHTML= total;
How can make mobile number verification in PHP like gmail or YouTube and more website
Sir app mobile sms verification tutorial kab bane ge jis me user ke number par code jaye or vo number verification kar sake please sir make this tutorial
can u teach me how to make alert text when we type wrong..example… when i want put number at text box at username box..it will give me red alert that we put wrong sentance
can you plz validate a form using events like if a text field is only for characters and a digit is entered in that field then it shows a message instantly & does not goes to the next field plz,plz do this
32 responses to “Basic HTML Form validation using JavaScript”
Please improve the quality and your accent, it doesn't help when trying to learn. Thanks!
i prefer validation with html when submitting forms.javascript is easy to hack just by using==1 or ' or anything of that kind.
where else if?
Hello…. thanks for the coding i will love to know… haw can i do this same thing but with more user and the controll of the tipe of user that is doing the loging… can you help me? thanks
This video is of server side validation which is not much used in today's date website..i want know how client side validation works..
<!DOCTYPE html>
<html lang="un">
<head>
<meta charset="utf-8"/>
<title>Authentication form</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<form name="loginform" action="index.html" onsubmit="return validateForm()" method="post">
username:<input type="text" name="username"/><br><br>
Password:<input type="password" name="passwords"/><br><br>
<input type="submit"value="submit"/>
</form>
<script type="text/javascript">
function validateForm()
{
return true;
var x=document.form["loginform"]["username"].value;
var y=document.form["loginform"]["pwd"].value;
if(x==null||x==" "||y==null||y==" ")
{
alert("user name and password must be filled");
}
return false;
}
</script>
</body>
</html>
I tried the same but i am not getting alert box in function validate form()
I want to take value from two input and add them and display in other input box… my code is not working !! can u fix the code..
<!DOCTYPE HTML>
<html>
<head>
<title>My javaWebpage</title>
<meta charset="utf-8"/>
<script type="text/javascript">
function myfunction()
{
var x=document.["myform"].["number1"].value;
var y=document.["myform"].["number2"].value;
var total=x + y;
document.getElementById("ans1").innerHTML= total;
}
</script>
</head>
<body>
<form action="#" method="post" name="myform" onsubmit="myfunction()">
<input type="number" name="number1" >
<input type="number" name="number2" > Answer:-<input type="text" id ="ans1" name="answer"><br>
<input type="submit" name="submitFORM" id="ans1" value="submit">
</form>
</body>
</html>
this is not successful
Is it a bad idea to store a Password in JS?
Thanks bro.
how to open a file
Good video. You should consider teaching coding in classrooms, you make it easy to understand. Keep it up!
I am trying to learn javascipt but valudation does not work all it does is says save password or doesnt have a popup
<html>
<head>
<script>
function submitFunction() {
var x=document.form["myForm"]["username"].value;
var y=document.form["myForm"]["password"].value;
if(x == null || x == "" || y == null || y == "") {
alert("Both fields can't be empty.");
} else {
if(x == "webi") {
if(y == "12345") {
alert("Login successful");
} else {
alert("Password do not match!");
}
} else {
alert("User doesn't exist");
}
}
}
</script>
</head>
<body>
<form name="myForm" onsubmit="submitFunction()">
username: <input type="text" name="username"><p>
password: <input type="password" name="password"><br>
<input type="submit" value="submit">
</form>
</body>
</html>
great video tomorrow is my comp practicals sure it will help
Nice post, I want to know, instead of alert, how I can pass an error message along html itself…
thank u very much i m looking forward for this tutorial. ?
thank u very much i m looking forward for this tutorial. ?
How can make mobile number verification in PHP like gmail or YouTube and more website
Sir app mobile sms verification tutorial kab bane ge jis me user ke number par code jaye or vo number verification kar sake please sir make this tutorial
its nice one
cool 😉
cool..that was so so much simple to understand….
its function not funcsion.
please improve your pronounciation btw the video helped me 🙂
out of so many vidoes i have understood so much from your videos.thankyou for.please uploap a video for registration from validation too.
thank you
Thanks for such a helpful video!
good one, Its really helped me a lot….thanks a lot .
Good video, learned a lot, but please improve quality.
can u teach me how to make alert text when we type wrong..example… when i want put number at text box at username box..it will give me red alert that we put wrong sentance
can you plz validate a form using events like if a text field is only for characters and a digit is entered in that field then it shows a message instantly & does not goes to the next field plz,plz do this
I'm sorry, but can you please improve the quality?(not trying to be rude)
O my God! At last I understand javascript + html! Thanks! Thanks! Thanks!
Thank you….try to navigate next page instead of throwing alert login successful using script validation may be that will be useful