I am using a website template which has a search form with an icon in the text field.
When a value is entered and the user clicks on 'Enter' the form is executed. However, when the search icon is clicked, nothing happens.
The icon is created via the awesome font library http://fontawesome.io/ and added via css
content: '\f002';
Here is a fiddle with the code: https://jsfiddle.net/BamBamm/df2gzkbb/10/
How can I fix this? Thank you.
#search form {
text-decoration: none;
position: relative;
}
#search form:before {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-transform: none !important;
}
#search form:before {
-moz-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
-ms-transform: scaleX(-1);
transform: scaleX(-1);
color: #7f888f;
content: '\f002';
cursor: default;
display: block;
font-size: 1.5em;
height: 2em;
line-height: 2em;
opacity: 0.325;
position: absolute;
right: 0;
text-align: center;
top: 0;
width: 2em;
}
input[type="text"] {
height: 2.75em;
}
input[type="text"] {
-moz-appearance: none;
-webkit-appearance: none;
-ms-appearance: none;
appearance: none;
background: #ffffff;
border-radius: 0.375em;
border: none;
border: solid 1px rgba(210, 215, 217, 0.75);
color: inherit;
display: block;
outline: 0;
padding: 0 1em;
text-decoration: none;
width: 100%;
}
body, input, select, textarea {
color: #7f888f;
font-family: "Open Sans", sans-serif;
font-size: 13pt;
font-weight: 400;
line-height: 1.65;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/3.1.0/css/font-awesome.min.css" rel="stylesheet" />
<div id="search" class="alt">
<form action="javascript:alert('Inner Function performed!');">
<input type="text" name="search_query" value="defaultValue"/>
</form>
</div>