0

I need to create a datepicker and the simplest thing doesn't work:

In my view :

@model SomeModel
<script type="text/javascript">
alert("works");
$(function () {
    $("#datepicker").datepicker({
        showOn: "button",
        buttonImage: "/SiteContent/images/Brand/icon_calendar.png",
        buttonImageOnly: true
    });
});
</script>

<div>
    <input name="input2" type="text" size="20" class="inputfield" id="datepicker" />
</div>

Am I putting the JS in wrong place ? The path to the image is fine. The button will not appear next to the input text field. Thank you,

1
  • have you included the jquery ui along with jquery Commented Sep 20, 2011 at 17:05

1 Answer 1

1

it works here http://jsfiddle.net/zPBv5/3/

you have to include jquery and jquery ui, and the order does matter

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js" type="text/javascript"></script>
Sign up to request clarification or add additional context in comments.

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.