Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a glyphicon work as a submit button?

I have a button of type Submit with text as edit for POST method in asp.net HTML.BeginForm.I want to replace it with a glyphicon-edit.How to achieve the same functionality as input.I am able to achieve the functionality using Edit button.I want the same functionality using glyphicon-edit

HTML

<br />

<input type="submit" class="btn btn-default" name="Editing" value="Edit" />

<div class="circle">
  <div class="glyphicon glyphicon-edit"></div>
</div>

CSS and Look of glyphicon-edit is included in a fiddle here

like image 764
Raviteja Avatar asked Dec 07 '15 05:12

Raviteja


People also ask

What is Glyphicon in HTML?

What are Glyphicons? Glyphicons are icon fonts which you can use in your web projects. Glyphicons Halflings are not free and require licensing, however their creator has made them available for Bootstrap projects free of cost.

How do I apply Glyphicons?

Use the <span> or <a> element. Set the class attribute of the <span> or <a> element as glyphicon then a space and then glyphicon-iconname.


1 Answers

You can write a button with a type submit and wrap an glyphicon inside

<button type="submit">
   <span class="glyphicon glyphicon-edit"></span>
</button>

Edit :

  • The button style will applied to glyphicon, but you can remote the default button css properties (for eg. background:none;border:none;padding:0;) and apply new style
  • onclick border appears ? - outline:none should solve the outline border issue onclick.
like image 187
Suman KC Avatar answered Sep 20 '22 07:09

Suman KC