HTML CSS JAVA SCRIPT PROJECT

 

How to Make a Portfolio Website using HTML , CSS, Java Script, Bootstrap, Jquery?


Code Download Section




Form Validation

Note: For Working Contact Form with Java Script | Received Data on Email

- Open Chrome browser.
- Type URL: https://smtpjs.com/
- Click on CDN
- Copy the URL:  https://smtpjs.com/v3/smtp.js
- Paste the URL on the html file in the body section below the code.
- For eg: <script src="https://smtpjs.com/v3/smtp.js>  </script> .
-  Again go back to smtpjs Website.
- Scroll down and copy the code from [2. Send an email using:]  box .
- Type the script in html file in the body section below the code. 
- For Eg: 

<script>
 function sendEmail(){
Email.send({
    Host : "smtp.gmail.com",
    Username : "itcomputerinstitutetikapur@gmail.com",
    Password : "tikapur@123",
    To : 'sanjayit62@gmail.com',
    From : document.getElememntById(email).value,
    Subject : "Inquiry Form",
    Body : "Name: "+ document.getElementById("name").value 
+ <"br">Email: +document.getElementById("email").value 
+ <"br">Phone No: +document.getElementById("phone").value 
+ <"br">Message: +document.getElementById("message").value 

}).then(
  message => alert("Message Sent Secussfully")
);
}
</script>

- Call the function in form tag
- <form onsubmit="sendEmail(); reset(); return false;">



Project 1 : Make one Form Validation LogIn Form ?

HTML Code :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Form Validation</title>
<script src="java.js"></script>
</head>
<body>
<form>
Username: <input type="text" id="user"> <br>
Password: <input type="password" id="pass"> <br>
<input type="submit" value="Login" onclick="valid()">
</form>
</body>
</html>


Java Script Code :

function valid()
{
var user= document.getElementById("user").value;
var pass= document.getElementById("pass").value;
if (user=="" || pass == "") 
{
alert(" Please Eneter Username And Password");
}
}







If you have any doubts, Please let me know

Post a Comment (0)
Previous Post Next Post