Tuesday 15 July 2014

c# - Textbox not show datepicker with javascript? -


I am using DevExpress to develop my website ... now I want to display datepicker aspxtextbox with jquery I am using. I do not use aspxDateEdit because I can not apply my CSS ... here is my code:

Javascript

  $ (function () {$ ("# & Lt;% = txtDate.ClientID%>"). Date picture ({dateFormat: 'dd / mm / yy', minuteDate: 0})});   

ASPX

  & lt; Dx: ASPxTextBox original = "true" CssClass = "span3" runat = "server" id = "txtDate" & gt; & Lt; Validation settings errorDisapplyMode = "text" errorframe style -forclor = "red" display = "dynamic" errorTippatPosition = "bottom" setfocus oner = "true" & gt; & Lt; Required field IsRequired = "True" ErrorText = "Value Required" /> & Lt; / ValidationSettings & gt; & Lt; / Dx: ASPxTextBox & gt;   

When I see the source code, input id = ContentPlaceHolder1_ctl00_txtDate .. What's wrong with my code?

You need to recieve jQuery and then both for the date picture to work (order Note) - & gt; JQuery UI

Then it will be something like this:

  & lt; Script src = "~ / scripts / jquery.js" & gt; & Lt; / Script & gt; & Lt; Script src = "~ / scripts / jquery-ui.js" & gt; & Lt; / Script & gt; & Lt; Script src = "~ / scripts / yourapp.js" & gt; & Lt; / Script & gt;   

I hope it helps.

Edit

In addition, it is not certain that Textbox ID is actually truncated, then try to remove the empty space:

  $ ("# & lt;% = txtDate.ClientID%>")    

No comments:

Post a Comment