Reputation: 137
I'm creating a web app and can't seem to figure this out.
I have a button here:
<form action="test" method="post" >
<input type="Submit" name="Submit" class="btn btn-lg btn-default">
</form>
When I test the code on my website, the button shows as follows:
How can I change the text of the button so that instead of it saying "Submit" it says "Home"? I've tried changing the name property of the button, but it still says "Submit".
I don't really know much about CSS and HTML, so if someone can walk me through on how to do this- that would be great.
Thanks :)
Upvotes: 3
Views: 113
Reputation: 54
<form action="test" method="post" >
<input type="Submit" value="Click Here" name="Submit" class="btn btn-lg btn-default">
</form>
Upvotes: 2
Reputation: 5071
You can use value="your text here"
inside, as follow:
<input type="Submit" name="Submit" value="My Text Here" class="btn btn-lg btn-default">
Do not forget to add /
for better coding:
<input type="Submit" name="Submit" value="My Text Here" class="btn btn-lg btn-default"/>
Upvotes: 2
Reputation: 1473
Too easy to change your input type button
name
use value
attribute in tag
i added a spinet this makes things clear for you. :)
<form action="test" method="post" >
<input type="Submit" value="HOME" name="Submit" class="btn btn-lg btn-default">
</form>
Upvotes: 1
Reputation: 2469
<form action="test" method="post" >
<input type="Submit" name="Submit" Value="Home" class="btn btn-lg btn-default">
</form>
You can change via value atts
Upvotes: 1
Reputation: 131
<form action="test" method="post" >
<input type="Submit" name="Submit" value="Click" class="btn btn-lg btn-default">
</form>
THe text of the button can be changed by value="watever"
Upvotes: 1
Reputation: 11
As others have mentioned above, you have to set the value tag and that will be used as the display text. By default a submit button text is submit.
Alternatively, you can use javascript/jquery if you want to change the button text during runtime.
Upvotes: 1
Reputation: 2373
<form action="test" method="post" >
<input type="Submit" name="Submit" value="Home" class="btn btn-lg btn-default">
</form>
Home ---- > Change it to whatever you want
Upvotes: 2