Friday 27 October 2017

From Validation in JavaScript with html and Css Complete Tutorial From Basic

Html code:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Form Validation</title>

<link href="css/style.css" rel="stylesheet" type="text/css"/>
</head>

<body>
<div id="wrapper"> 




<div id="formbox">

<table> 


<tr>  <td style="width:30px">Email </td>   <td> <input type="text" id="email" onChange="checkemail()" style="border-radius:20px 20px 20px 20px;height:35px;width:200px"/> </td>  <td> <span id="emailerror"> </span>  </td>  </tr>


<tr>  <td>Password </td>   <td> <input type="password"  id="pwd" onChange="checkPASSWORDLENGTH()" style="border-radius:20px 20px 20px 20px;height:35px;width:200px"/> </td>  <td> <span id="pwderror"> </span>  </td>  </tr>



<tr>  <td>Confirm Password </td>   <td> <input type="password" id="cpwd" onChange="confrimpassword()"  style="border-radius:20px 20px 20px 20px;height:35px;width:200px"/> </td>  <td> <span id="cpwderror"> </span>  </td>  </tr>

<tr>   
 <td>


 </td> 
 <td>
<button> Submit!</button>

 </td> 
 
 
  </tr>



</table>


 </div>






</div>

<script src="js/js.js"> </script>


</body>
</html>

css code:

@charset "utf-8";
/* CSS Document */
body
{ margin:0 auto;
padding:0px;

}

#wrapper
{ width:100%;
height:1000px;
background-image:url(../img/login.jpg);
background-size:100% 1000px;

}
#formbox
{ width:500px;
height:300px;
background-color:rgba(243, 242, 242,0.4); 
position:absolute;
 margin-left:300px;
 margin-top:300px; 



}
td
{ padding:15px;
}

Js code:

// JavaScript Document

function checkemail()
{
var c=document.getElementById("email").value;
var pos=c.search("@");
if(pos==-1)
{
document.getElementById("emailerror").innerHTML="Invalid Email Id";
document.getElementById("emailerror").style.color="red";
}
else
{
var domainname=c.substring(pos+1); 

var d= domainname.toLowerCase();

if(d!=="yahoo.com")
{
document.getElementById("emailerror").innerHTML="use correct domain name like yahoo.com";
document.getElementById("emailerror").style.color="red";

}
else
{
document.getElementById("emailerror").innerHTML="valid Email Id";
document.getElementById("emailerror").style.color="green";
}


}



}







function checkPASSWORDLENGTH()
{
var c=document.getElementById("pwd").value;
var l=c.length;
if(l<8 || l>15)
{
document.getElementById("pwderror").innerHTML="Password should contain atleast 8 characters!";
document.getElementById("pwderror").style.color="red";
}

else
{
document.getElementById("pwderror").innerHTML="valid Password ";
document.getElementById("pwderror").style.color="green";
}
}







function confrimpassword()
{

var pwd=document.getElementById("pwd").value;
var cpwd=document.getElementById("cpwd").value;

if(pwd!==cpwd)
{
document.getElementById("cpwderror").innerHTML="Password Mismatch";
document.getElementById("cpwderror").style.color="red";
}
else
{
document.getElementById("cpwderror").innerHTML="Password match";
document.getElementById("cpwderror").style.color="green";

}


}


image and jumbotron class in bootstrap





<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>grid in bs</title>

<link type="text/css" rel="stylesheet" href="css/bootstrap.css"/>

<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css"/>

<link type="text/css" rel="stylesheet" href="css/bootstrap-theme.css"/>

<link type="text/css" rel="stylesheet" href="css/bootstrap-theme.min.css"/>



<style>



body

{ background-color:#000;

 

}



#SIDE a:hover

{ background-color:#09F;

color:#fff;

font-family:"Courier New", Courier, monospace;

font-size:26px;



}



</style>



</head>



<body>



<div class="container" style="height:1000px; background-color:#069">



<div class="row" style="height:200px; background-color:#096;background-image:url(img/1.jpg); background-size:100% 1000px">



<div class="col-sm-4" style="height:200px; ">



<img src="img/logo (1).png" style="width:80%;height:200px"/>

 </div>



<div class="col-sm-4" style="height:200px; "> </div>



<div class="col-sm-4" style="height:200px; ">



</div>





</div>



<!-- HEad section end..............................................  -->

<div class="row" style="height:50px; background-color:#036">









</div>





<DIV class="row" style=" height:1000px; background-color:#CCC">



<div ID="SIDE" style="height:1000px;background-image:url(img/1.jpg); background-size:100% 1000px" class="col-sm-2">



<h3>ASIDE BAR </h3>







<nav>



<ul class="nav  nav-pills  nav-stacked">



<li class="active"> <a href="#" >Home </a> </li>





<li> <a href="#">About Us </a> </li>





<li> <a href="#">Gallery </a> </li>





<li> <a href="#">Contact Us </a> </li>





<li> <a href="#">Admission </a> </li>





<li> <a href="#">Home </a> </li>





<li> <a href="#">About Us </a> </li>





<li> <a href="#">Gallery </a> </li>





<li> <a href="#">Contact Us </a> </li>





<li> <a href="#">Admission </a> </li>











</ul>



</nav>











</div>



<div style="background-color:white;height:1000px;background-image:url(img/2.jpg); background-size:100% 1000px" class="col-sm-8">





<div style="width:100%; background-color:rgba(82, 99, 158,0.4)">

<div class="jumbotron" >



<h1>Bootstrap Tutorial </h1>



<p>Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web. </p>



</div>



</div>



<table style="margin-left:90px">



<tr>

<td>

<img src="img/slide1.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />



 </td>



<td>

<img src="img/slide2.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />



 </td>

 

 

 <td>

<img src="img/slide3.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />



 </td>

 

 



 </tr>



 <tr>

<td>

<img src="img/slide2.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />



 </td>



<td>

<img src="img/slide3.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />



 </td>

 

 

 <td>

<img src="img/slide1.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />



 </td>

 

 



 </tr>





 <tr>

<td>

<img src="img/slide1.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />



 </td>



<td>

<img src="img/slide2.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />



 </td>

 

 

 <td>

<img src="img/slide3.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />



 </td>

 

 



 </tr>













</table>







</div>





<div style="background-color:#C03;height:1000px; background-image:url(img/1.jpg); background-size:100% 1000px" class="col-sm-2"> </div>











</DIV>



























</div>



<!--  CONTAINER end..............................................  -->



























<script src="js/bootstrap.js"> </script>

<script src="js/bootstrap.min.js"> </script>

<script src="js/jquery.js"> </script>

<script src="js/jquery-migrate-1.4.1.min.js"> </script>





</body>



</html>

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...