Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 136
  • Last Modified:

Why does this not work?

Attached is a screenshot of the app that I'm looking to mimic. It's the calendar that pops up when the user clicks into the text field.

Here are the libraries I've got referenced in my header:

<link href="localhost/development/js/jquery-ui-1.10.4.custom/css/blitzer/jquery-ui-1.10.4.custom.css" rel="stylesheet">
<script type="text/javascript" src="localhost/development/js/jquery-ui-1.10.4.custom/js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="localhost/development/js/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js"></script>

Here's my JavaScript:

Here's my JavaScript:

<script type="text/javascript">

$( "#s4date" ).datepicker({ dateFormat: "yy-mm-dd" });

</style>

...and here's my HTML:

<input type="text" size="50" id="s4date" name="s4date">

Probably something ridiculously easy and obvious, but I'm clueless. What am I missing?
screenshot.docx
0
brucegust
Asked:
brucegust
  • 2
2 Solutions
 
GaryCommented:
And what exactly is not working?

Included screenshots directly in your question, don't embed them in another document.
0
 
brucegustAuthor Commented:
On the working screen, you an put your mouse in the text field and the calendar pops up. Nothing pops up in my attempt to duplicate the same effect.

In the past, when confronted with that kind of problem, it was a scenario where my libraries weren't being read or I was missing some crucial resource. But in this instance, all the required files and libraries and accurately referenced, hence my not knowing what could be wrong.

And as far screenshots, at the risk of sounding utterly clueless, I'm hitting "Print Screen" and apart from pasting that either into a new jpg or a Word doc, how do you embed what's sitting on your clipboard directly into the question?
0
 
GaryCommented:
Your paths look a bit weird
localhost/development

That means it is looking at a folder called localhost in the folder where you page resides

Re the image
Once it's pasted into Word you can right click the image and do a Save As then attach it here as a normal image.
0
 
Snarf0001Commented:
Well, 2 possible things:

1) The end of the script tag you have in there is </style> not </script>, but I'm assuming that was just a typo pasting in here.
2) If your script is at the top of the page, then you'll be running the jquery selector before the element has rendered on the page, and won't find it.  Put the function in side doc.ready.


    <script type="text/javascript">
        $(document).ready(function () {
            $("#s4date").datepicker({ dateFormat: "yy-mm-dd" });
        });
    </script>

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now