Sunday 15 January 2012

jquery - DateTimePicker is not showing -


I am facing a problem with the datetime picker in jquery in MVC4. Here's my code:

  @ html Textbox ("RELIEVING_DATE", model. RLIEVING_DATE) $ (function () {$ ("#RELIEVING_DATE") Datepicker ();}   

But the date time picker is showing an error and Untitled type error: Undefined properties can not be read inline.

In my model RELIEVING_DATE one is not showing

I want to give it a default value.

Please help.

The first thing written in your post is that you $ (function () { one ending ); in the end.

Also make sure that you right into your page with jQuery and jQuery UI scripts If you are using bundles then you may need the following script before the script that is appending the date picker:

  @ Scripts.Render ("~ / Bundles / jquery ") @ scripts.Render (" ~ / bundle / jqueryui ")   

Normally the ~ / bundle / jak yuri bundle already _Layout.cshtml is included if you have used the Internet application template to create your project.

One more thing you should verify is that you do not have many fields with the same ID, and if it's @html If the textbox is inside an editor template, then id can not be #RELIEVING_DATE , but prefixed with shipping property, for example #SomeProperty_RELIEVING_DATE . Look at the HTML generated in the browser to see the exact ID. You can also specify a square in the field:

  @ Html.TextBoxFor (x = & gt; x.RELIEVING_DATE, new {@class = "datepicker"})  < / Pre> 

and then:

  $ (function () {$ ('datepicker'). Datepicker ();});    

No comments:

Post a Comment