Solved

MVC 5 Bootstrap datepicker in IE/Firefox

Posted on 2014-07-24
2
5,672 Views
Last Modified: 2014-07-24
Hi

I have a MVC 5 website made using Razor layout and Bootstrap. I have a datepicker on my page, which works perfectly in Chrome, but not at all in Internet Explore 10/11 or in FireFox (latest version).

I have the following code in my View:

<div class="row">
    <div class="col-sm-4">
      <div class="form-group">
        <div class="input-append date" id="dpFromDate" data-date="13-02-2012" data-date-format="dd-mm-yyyy">
          @Html.LabelFor(m => m.FromDate)
          <input type="date" id="FromDate" value="13-02-2012" class="form-control" />
          <div class="description">Datoen skal være i formatet dd-MM-åååå</div>
        </div>
      </div>
    </div>
    <div class="col-sm-4">
      <div class="input-append date" id="dp3" data-date="14-02-2012" data-date-format="dd-mm-yyyy">
        <div class="form-group">
          @Html.LabelFor(m => m.ToDate)
          <input type="date" id="startdato" value="14-02-2012" class="form-control" />
          <div class="description">Datoen skal indtastes i formatet dd-mm-åååå</div>
        </div>
      </div>
    </div>
  </div>

Open in new window


As mentioned the datepicker works in Chrome, but in IE and Firefox it is just a "dumb" input field.

Does anyone know how to make it work in IE and Firefox?

/Søren
0
Comment
Question by:poultarp
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 40217459
Html5 input type="date" is not supported in IE and FF.
html5 Date input supporthttp://www.w3schools.com/html/html5_form_input_types.asp

On how to make it work, you can use some external plugins e.g.: http://www.eyecon.ro/bootstrap-datepicker/
0
 
LVL 1

Author Closing Comment

by:poultarp
ID: 40218600
Well - guess that explains it!

Thanks for the link to the plugin.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question