I currently have a textbox that displays the datepicker when clicked. However, there is now a requirement to add a calendar icon inside the textbox. The datepicker should be displayed when either the calendar icon or the textbox is clicked. Below is the code I am using:
@Html.TextBoxFor(model => model.myDatePicker, new { @class = "form-control myDatePicker" })
<span class="glyphicon glyphicon-calendar"></span>
The issue is that the calendar icon is displayed on the next line because the Span element is outside @Html.TextBoxFor. (I do not have enough reputation points to post images, so I cannot provide an example)
Is there a way to include the calendar icon inside @Html.TextBoxFor?
Alternatively, should I add CSS to achieve this?
Any suggestions or input on this matter would be greatly appreciated.