Pub Pixel Avatar Image

HTML5 Snippets - Customize The Text That Is Displayed On Your Forms Submit Button

Published:

Rate Article (Sign in and be the first to rate this article.)

Article Details

Views: 1193

First Published:

Word Count: 508

Edition: 1

Now if you wish to change the text that is displayed on your forms submit button, which is usually the word "Submit" or the words "Submit Query" depending on the browser. Then all you have to do is add the value attribute to the <input> element that has its type attribute set to the value of submit. The value attributes value can be any text that you would like to see displayed on your forms submit button.

It's important to remember that when the value attribute is added to an <input> element that has its type attribute set to the value of submit and has the name attribute included. That very same name attribute will then pass the text that is displayed on the submit button created by the <input> elements value attribute, when the form is submitted. The name attribute will actually send the text that is displayed on the submit button to the action attributes URL value for the <form> element, which is a URL to a script that will process the forms user submitted data.

Now let me first show you the code by itself for the HTML snippet for customizing the text that is displayed on your forms submit button using the <input> elements value attribute. And then I will show you how to code and where to place the HTML snippet for both HTML5 and XHTML5.

Here is the HTML code snippet below to customize the text that is displayed on your forms submit button using the <input> elements value attribute.


value="Text that will be displayed on the submit button"

Here is the HTML code snippet to customize the text that is displayed on your forms submit button using the <input> elements value attribute for HTML5 in the example below.


<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">
 <title>Welcome To HTML5</title>
</head>
<body>
  
 <form action="http://www.example.com/validate-form.php" method="post">  
  Full Name: <input type="text" name="full_name">  
  <input type="submit" name="submit_full_name" value="Register Your Full Name">  
 </form>  

</body>
</html>

And here is the HTML code snippet to customize the text that is displayed on your forms submit button using the <input> elements value attribute for XHTML5 in the example below.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">  
<head>
 <meta charset="UTF-8" />
 <title>Welcome To XHTML5</title>
</head>
<body>

 <form action="http://www.example.com/validate-form.php" method="post">  
  Full Name: <input type="text" name="full_name" />  
  <input type="submit" name="submit_full_name" value="Register Your Full Name" />  
 </form>  

</body>
</html>

Article Tags

Tag Article (Sign in if you want to tag this article.)

Share This Article

Send To Facebook Link

Tweet This Link

Send To LinkedIn Link

Send To StumbleUpon Link

Digg This Link

Send To Google Plus One Share Link

Send To Reddit Link

Send To Tumblr Link

Send To Delicious Link

Send To FriendFeed Link

Send To Diigo Link

Email Link

AddThis Link

0 Comments

Leave Comment (Sign in and be the first to comment on this article.)

Important

This site cannot guarantee the accuracy of articles, comments, answers and other types of content or media submitted by members or anonymous users and guests, and we recommend that you use common sense when following any advice or information found on this site. Read our full Content Disclaimer Agreement for further information.