0

I try to use jQueryUIHelpers.Mvc3 but when i click on the box the datebox picker not appear. I installed the jqueryUIHelpers.Mvc 3 package like here http://jqueryuihelpers.apphb.com/Docmo/Overview/GettingStarted But when i am running the page and click the date box nothing appears. Here is my view:

           @model MvcApplication4.Models.Reservation
          @using JQueryUIHelpers
          @{
         ViewBag.Title = "Create";
                }
        <head>
       <h2>Create</h2>
           <title>jQuery UI Helpers - @ViewBag.Title</title>

                 <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
             <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

          <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
       <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />       
      <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
      <script src="@Url.Content("~/Scripts/jquery-ui-1.8.18.min.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/jquery-ui.unobtrusive.min.js")" type="text/javascript"></script>   
         </head>

       @using (Html.BeginForm()) {
     @Html.ValidationSummary(true)
<fieldset>
    <legend>Reservation</legend>

    <div>
                            <label for="anotherDate">Select another date: </label>
                                                                                                   @(Html.JQueryUI().Datepicker("anotherDate").MinDate(DateTime.Today).ShowButtonPanel(true)
      .ChangeYear(true).ChangeMonth(true).NumberOfMonths(2))
    </div>
Bibin Velayudhan
  • 3,043
  • 1
  • 22
  • 33
jonny
  • 797
  • 4
  • 24
  • 41

2 Answers2

1

May be it is because you have called jquery after the validate js and an error occurred and script stopped functioning. Check your error console and include jquery-1.7.1.min.js before all other jquery plugin js and try again. I didnt find any error in the datepicker initialisation function.

Bibin Velayudhan
  • 3,043
  • 1
  • 22
  • 33
  • I included jquery-1.7.1.min.js before all ather plugin but still not working .I dont get any error but when click on the box no datepicker appears – jonny Apr 27 '12 at 14:17
  • 1
    its working i just needed to update query-ui.unobtrusive-0.3.1.min.js to query-ui.unobtrusive-4.0.min.js – jonny Apr 27 '12 at 14:28
1

I believe it is because when you run Install-Package jQueryUIHelpers.Mvc3 the current version installs ~/Scripts/jquery-ui-1.8.19.min.js and ~/Scripts/jquery-1.7.2.min.js. However, the demo code references version ~/Scripts/jquery-ui-1.8.18.min.js and ~/Scripts/jquery-1.7.1.min.js which is the version you have used. Unless you have manually installed this file, you will not be referencing the correct version.

Dangerous
  • 4,818
  • 3
  • 33
  • 48
  • @ianco slovak - I just looked at your code again. You do not need the `@using JQueryUIHelpers` in your code as this is already included in the namespace in the web.config for your. Also, the script `~/Scripts/jquery-ui.unobtrusive.min.js` should be `~/Scripts/jquery-ui.unobtrusive.min-0.4.0.js`. However, I assume that both of these must now be correct as the answer has been accepted. – Dangerous Apr 27 '12 at 14:33