0

im new to javascript and Jquery and i just cant seem to get this working. I believe the problem in specific is the reference to the jquery files thats not working but i could be wrong. Below is the relavent code.

<head runat="server">
<title>Expense Report Admin Portal</title>
<link rel="stylesheet" type="text/css" href="Content/admin.css" />
<%--<script type="text/javascript" src="Scripts/jquery-ui-1.11.4/jquery-ui.js"></script>--%> 
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>


<script>
$(function() {
  $( '#<%=datepicker.ClientID%>' ).datepicker();

});
</script>

</head>



<asp:TableCell>
      <asp:TextBox ID="datepicker" runat="server"></asp:TextBox>
                            </asp:TableCell>
1
  • If you are new to this you should copy/paste the fully working example from their website to your page. Get it working. And then customize from that point on. jqueryui.com/datepicker , see the link on the page view source Commented Apr 20, 2016 at 19:02

2 Answers 2

1

I was right, there was something wrong with the jquery references. I took Igor's advice above, and while i didnt copy ALL the code, i did replace all my references to jquery with the one in the example and it worked.

Sign up to request clarification or add additional context in comments.

Comments

0

i think you comment jquery reference. uncomment this line. the belwo example work for me.

include => jquery-ui.css include => jquery-1.10.2.js include => jquery-ui.js

<!doctype html>
 <html lang="en">
 <head>
   <meta charset="utf-8">
   <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="http://code.jquery.com 
  ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
   <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js">
 </script>
 <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
   $(function() {
     $( "#datepicker" ).datepicker();
  });
   </script>
</head>
<body>

 <p>Date: <input type="text" id="datepicker"></p>


 </body>
 </html>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.