• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » Html » Tutorial » HTML button tag
Next →
← Prev

HTML button tag

By Dinesh Thakur

SUBMIT- After filling up the form, the user needs to submit the information. An <INPUT> tag with type = submit provides a button that submits the information in the completed form to the URL, given as the action attribute of the FORM tag.

The information is submitted using the HTTP request type specified by Form’s method attribute .

Syntax 
<INPUTtype="submit" Value="button label text">

Value: This attribute will change the text mentioned on the button just substitute your text in the value attribute. By default “submit” as written over the button. The button size will be controlled directly by the text length.

RESET: The reset value of the type attribute clears all form entries to the default one or leaves them blank if no defaults are specified Not al HTML forms will use this feature, but it can help users to start afresh or if they want to reconsider the default options.

Syntax <INPUTtype="reset"Value=" button label text">

The “Value” attribute again is used to specify the text on the button. These buttons can be placed anywhere in the form. But the best place for them is below all the other input fields.

The following lines of code will add these buttons to our sample form.

<html> 
<head><title> text fields</title></head> 
<bodybgcolor="pink"> 
<palign="center"><b>admission form</b> <form> <p> 
<inputtype="text"name="name"value="enter your name:"size="25"maxlength="30"> name<br><br> <inputtype="password"name="passwd"size="25"maxlength="30"><br><br> <inputtype="text"name="address"size="25"maxlength="30"> address<br><br> <inputtype="radio"name="sex"value="male"checked>male<br> <inputtype="radio"name="sex"value="female">female<br> 
<selectname="country"> 
<optionvalue="india">india 
<optionvalue="america"> america 
<optionvalue="australia"> australia 
<optionvalue="new zealand"> new zealand 
<optionvalue="china"> china 
</select><b>country</b> 
<textareaname="comments"rows=2cols=20wrap="virtual:"> place your comments here: </textarea> <b> comments </b> 
<palign=center> 
<inputtype="submit"value="submit"> 
<inputtype="reset"value="reset"> 
</form> 
</body> 
</html> 

An image can also be used for submit button. The image value of the “type” attribute provides a graphical submit button. It works exactly same as the submit button.

Syntax     <INPUTtype="image"src="image_url"height="n"width="m"alt="alternative text ""border = 0">

src: This attribute gives the URL of the image source file.

Width: To specify the width of image.

Height: To specify the height of image.

Alt: On rolling mouse over the image, the text mentioned is displayed. If someone is running without images they can still submit the form.

Border: To specify border for the image. In the syntax it turns off the border. The image value is by default for a submit button only. It cannot make a reset image button.

The following code adds an image submit button to our sample form.

<html> 
<head><title> text fields</title></head> 
<bodybgcolor="pink"> 
<palign="center"><b>admission form</b> <form> <p> 
<inputtype="text"name="name"value="enter your name:"size="25"maxlength="30"> name<br><br> <inputtype="password"name="passwd"size="25"maxlength="30"><br><br> <inputtype="text"name="address"size="25"maxlength="30"> address<br><br> <inputtype="radio"name="sex"value="male"checked>male<br> <inputtype="radio"name="sex"value="female">female<br> 
<selectname="country"> 
<optionvalue="india">india 
<optionvalue="america"> america 
<optionvalue="australia"> australia 
<optionvalue="new zealand"> new zealand 
<optionvalue="china"> china </select><b>country</b> <textareaname="comments"rows=2cols=20wrap="virtual:"> place your comments here: </textarea> <b> comments </b> 
<palign=center> 
<inputtype="image"src="c:\windows\hlpglobe.gif"alt="submit"width=55height=40> <inputtype="reset"value="reset"> 
</form> 
</body> 
</html>

 

You’ll also like:

  1. The hr tag in HTML
  2. HTML Anchor Tag
  3. HTML table tag
  4. HTML fieldset tag
  5. HTML span tag
Next →
← Prev
Like/Subscribe us for latest updates     

About Dinesh Thakur
Dinesh ThakurDinesh Thakur holds an B.C.A, MCDBA, MCSD certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps.

Dinesh Thakur is a Freelance Writer who helps different clients from all over the globe. Dinesh has written over 500+ blogs, 30+ eBooks, and 10000+ Posts for all types of clients.


For any type of query or something that you think is missing, please feel free to Contact us.


Primary Sidebar

HTML Tutorials

HTML Tutorials

  • HTML - Home
  • HTML - History
  • HTML - Lists
  • HTML - Unordered List
  • HTML - Ordered Lists
  • HTML - Frame Tag
  • HTML - Input Type
  • HTML - Input Type="File"
  • HTML - Input Type="Hidden"
  • HTML - Form Tag
  • HTML - Img Tag
  • HTML - Anchor Tag
  • HTML - Table Tag
  • HTML - Span Tag
  • HTML - Button Tag
  • HTML - Doctype
  • HTML - Fieldset Tag
  • HTML - Links Tag
  • HTML - Drop Down Menu
  • HTML - Accesskey
  • HTML - Cgi
  • HTML - Post Method
  • HTML - Background Image
  • HTML - Text Area
  • HTML - TabIndex
  • HTML - Align Center
  • HTML - Address Tag
  • HTML - Thumbnails
  • HTML - Marquee Tag
  • HTML - Line Break
  • HTML - Blockquote
  • HTML - HR Tag
  • HTML - Image Center
  • HTML - Center Text
  • HTML - Link CSS
  • HTML - Html Vs Html5

Other Links

  • HTML - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2023. All Rights Reserved.