HTML | Tags and Attributes [FORM] [BUTTON]


Ü How to create button in a form ?

            To create a form we use <FORM>...</FORM> tags. To create a form with buttons we need to use the following,
                             <INPUT TYPE=”....” VALUE=”......”>
            We can use three values of the attribute TYPE, they are SUBMIT, RESET, IMAGE. What we give as the value of the VALUE attribute
appears on the button. But exception is the IMAGE. When we are using the type IMAGE, we will have to input the following,
                             <INPUT TYPE=”....” NAME=”....” SRC=”....”>
            We need to give a name as the value of the NAME attribute and as the value of the SRC attribute we will give the address of the image file we are going to use. Now consider the following input and output as example.
Input :
<HTML><HEAD><TITLE> FORM </TITLE></HEAD>
<BODY>
<P ALIGN="CENTER">
    <FORM>
      <INPUT TYPE="SUBMIT" VALUE="EAT THIS">
      <INPUT TYPE="RESET" VALUE="GO TO FRESH">
      <INPUT TYPE="IMAGE" NAME="GO ON" SRC="G:\Personals main\Tanmay\HTML\Single pc.gif" BORDER=0>
    </FORM>
</P>
</BODY></HTML>
Output:

Use of <BUTTON> tag :


          To provide a submit button we can use the following code,
Input Code :
<HTML><HEAD><TITLE> FORM </TITLE></HEAD>
<BODY>
<BUTTON TYPE=”SUBMIT” VALUE=”SUBMIT” NAME=”SUBMIT” >Click Here</BUTTON>
</BODY></HTML>



Author: Tanmay Chakrabarty

Tanmay Chakrabarty is a former CSE student, currently working as a Senior Software Engineer with 5+ years of experience in the field of Web Application development in PHP+MySQL platform with strong skills in Javascript, JQuery, JQuery UI and CSS. He tries to write notes every week but fails due to heavy loads of duty.

Recommended Recommends

Comments

Contact Us