Introducing DotNetFunda.com on mobile http://m.dotnetfunda.com ! Be with DotNetFunda.com on the go !
Go to DotNetFunda.com
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 605 |  Welcome, Guest!   Register  Login
Home > Articles > HTML 5 > HTML5 Demo registration form

HTML5 Demo registration form

Article posted by Ogipansrk on 1/12/2012 | Views: 3186 | Category: HTML 5 | Level: Beginner | Points: 250 red flag


This article gives you a practical implementation on how to use HTML5 to create a simple registration form.

Introduction


HTML5 DEMO
--------------

Objective


CREATING SIMPLE REGISTRATION FORM WITH HTML5.

This article gives you a practical implementation , on how to use HTML5. 

I have used VISUAL STUDIO 2010.You can use any other text editor software.

Step1: To enable HTML5 FOR VISUAL STUDIO 2010:

 GoTo Tools >>Options>>TextEditor>>Html>>Validation>>from target select HTML5.


Aim To Create an Employee Registration Form:
--------------------------------------------
For creating Registration Form , I Have used only the below types:

a) Label : Used for Displaying Text.
  For this I have added an attribute called "FOR".
  The "FOR" indicateds to which this lable is bound to.
b) Input : HTML5 supports different attributes suchas, Date,Autofocus,Required etc.
  We will discuss them as we go through this article.


Lets us discuss about the attributes which we use in this demo.

AutoFocus: If you are a Asp.net developer , you have faced situation ,when
   page loads , should focus on the textbox. For this we write code.
   But in HTML5 , we just include an attribute like below:
 
Example: <input type="text" autofocus="true"/>

PlaceHolder:  It places a watermark in textbox.
        Supppose you want hint enduser how the information should be entered.Then this attribute should be     used.

    Example: <input type="text" PlaceHolder="Enter FirstName"/>



Date : If you want to use datecontroller,then simple include this attribute.
       
Example: <input type="date" id="txtDate" />


Required Field : You want some fields as mandatory fields, for this purpose, include "Required" attribute.

Validation: HTML5 supports validation when we include "Required" attribute.

 Example:   <input type="email" id="txtEmail" required  />

        When user  enter email , before submitting it will check wehther it is Entered in Proper Format.



Using the code


<table>
        <tr>
            <td><label for="txtFirstName">First Name:</label></td>
            <td> <input type="text" id="txtFirstName" placeholder="First Name"   required/></td>
        </tr>
       <tr>
            <td> <label for="txtLastName">Last Name:</label></td>
            <td><input type="text" id="txtLastName" placeholder="Last Name" /></td>
        </tr>

          <tr>
            <td><label for="txtAge">Age:</label></td>
            <td><input type="number" id="txtAge" /></td>
        </tr>

          <tr>
            <td><label for="txtEmail" >Email:</label></td>
            <td> <input type="email" id="txtEmail" placeholder="opispark@microsoft.com" required  /></td>
        </tr>
          <tr>
            <td><label for="txtDate">Date:</label></td>
            <td><input type="date" id="txtDate" /></td>
        </tr>
          <tr>
            <td></td>
            <td><input id="Submit1" type="submit" value="submit" runat="server"  /></td>
        </tr>
        
    </table>   


Conclusion


This article gives you basic idea how to use HTML5 in asp.net application.
I have tested this code in opera, not sure whether other browser support these attributes.

Happy Coding!


If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.

Page copy protected against web site content infringement by Copyscape
Found interesting? Add this to:



Please Sign In to vote for this post.

Latest Articles from Ogipansrk

About ogipansrk hc

Experience:0 year(s)
Home page:http://www.dotnetfunda.com
Member since:Sunday, December 04, 2011
Level:Starter
Status: [Member]
Biography:
 Responses
Posted by: Arefin | Posted on: 12 Jan 2012 10:51:52 PM | Points: 25

okay good article. But how you will get HTML5 in target combobox. I didn't see HTML5 in target combo. Is it necessary to install VS2010 service pack 1?

Posted by: Ogipansrk | Posted on: 13 Jan 2012 12:38:00 AM | Points: 25

You need to install VS2010 sp1.

Posted by: Patel28rajendra | Posted on: 14 Mar 2012 03:30:17 AM | Points: 25

Hi

very helpful article for learning Html 5

Thanks

Rajendra Patel

>> Write Response - Respond to this post and get points
Related Posts

In this article you will learn HTML5 new descriptive elements.

HTML 5 has a very nice drawing API in the form of new Canvas element. Canvas is used for rendering graphs, game graphics, or other visual images on the fly. Canvas is a rectangular area that we can add to our HTML5 page. In this article, we shall learn how to draw a shape on the HTML 5 Canvas and save it as image on the server.

In this article, we are going to learn How to play audio in the HTML5 and how to control the audio play using in HTML element.

In this article, we are going to learn new form elements introduced in HTML5.

More ...
About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/27/2012 7:39:50 PM