Gadgets

Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Thursday, 19 November 2015

Include one HTML file into other HTML file

Include one HTML file into other HTML file 
We have different ways to include one html file into other html page, using 
1.            <frame>
2.            <iframe>
3.            <java script>. we have different ways in java script.

if we use <frame> and <iframe> to include one html file into other html file, that web page shows border lines for each html file and it look like separate pages.  
Here is the simple way to include one html file into other html file by using javascript. 
Using <frame>: 
Here I taken 4 HTML files
header.html, body.html, footer.html
I included above three html files into home.html 
<html>
    <frameset rows="50px,150px,50px">
        <frame src="header.html"/>
        <frame src="body.html"/>
        <frame src="footer.html"/>
    </frameset>   
</html> 

Output for above example:
 Using javascript: 
Here I taken 3 html files: header.html, body.html, footer.html
I included header.html and footer.html files into body.html file.

       <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
Above link is required 
Javascript code for include html file
        <script>
             $(function(){
        $("#headerContent").load("header.html");
        $("#footerContent").load("footer.html"); 
    });
        </script>
<div id="headerContent"></div>
<div id="footerContent"></div>
 Header.html 
<html>   
    <body>       
       <h1>Welcome to Hyderabad</h1>
        <h3> HOME | ABOUTUS | SERVICES | VISIT PLACES | CAREER | CONTACT </h3>       
    </body>
</html> 
 Footer.html 
<html>   
    <body>
              <h1>Thank you, visit  again</h1>       
    </body>
</html>  
Body.html
<html>
    <head>
       <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
        <script>
             $(function(){
        $("#headerContent").load("header.html");
        $("#footerContent").load("footer.html"); 
    });
        </script>        
    </head>
    <body>
        <div id="headerContent"></div>        
        <h1>Tourist Places</h1>
        <p>1. Charminar</p>
        <p>2. Hussain sagar</p>
        <p>3. Birla mandir</p>
        <p>4. Ramoji film city</p>
        <p>5. Golconda fort</p>       
        <div id="footerContent"></div>
    </body>
</html>
Output for above example:


Monday, 29 December 2014

Conform Password with client side validation



Conform Password with client side validation

In this article I explained that, HTML Conform password with client side validation. Here in this form I taken password and conform password, here I taken password pattern, that password should be  a-z,A-Z,0-9 and password length is between 8 to 30 letters.




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form action=""method="post">
<table align="center">
<tr><td>Password :</td><td><input type="password" name="psw"  pattern="[a-zA-Z0-9 ]{8,30}"tabindex="1"class="input-box"onchange="this.setCustomValidity(this.validity.patternMismatch ? 'Password contain at least 8 charecters':'');if(this.checkValidity())form.cpsw.pattern=this.value"required/></td></tr>
<tr><td>Conform Password :</td><td><input type="password" pattern="[a-zA-Z0-9 ]{8,30}"name="cpsw"  tabindex="2"class="input-box"onchange="this.setCustomValidity(this.validity.patternMismatch ? 'Please enter same password as above':'');"required/></td></tr>
<tr><td></td><td><input type="submit" value="SignUp" tabindex="3"/></td></tr>
</table>
</form>
</body>
</html>


HTML Login form with validation

Password :
Conform Password :

HTML Login form with validation



HTML Login form with validation
In this article I explained that, HTML Login form with client side validation. Here in this form I taken email id and password, in this form we should give the correct email id pattern otherwise it will not take wrong email id pattern and here I taken password pattern, that password should be  a-z,A-Z,0-9 and password length is between 8 to 30 letters.



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form action="" method="post">
<table align="center">
<tr><td>Email id :</td><td><input type="email"name="eid" pattern="^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$" tabindex="1"required /></td></tr>
<tr><td>Password :</td><td><input type="password"name="psw" tabindex="2" pattern="[a-zA-Z0-9 ]{8,30}"required/></td></tr>
<tr><td></td><td><input type="submit" value="SignIn"tabindex="3"/></td></tr>
</table>
</form>
</body>
</html>
Email id :
Password :

Friday, 12 September 2014

Text Style Zoom



Text Zoom:

<style>
.container{
margin:0px auto;
width: 1000px;
}
#textzoom a{
color:  #0081C2;
font-family: 'Corbel';
font-size:4em;
font-weight: bold;
text-decoration: none;
transition:all 2s ease-in-out;
}
#textzoom a:hover{
font-size:8em;
transition:all 2s ease-in-out;
}
</style>
<div class="container">
<div id="textzoom">
<a href=""> Text Zoom</a>
</div></div>

JSP Page