Solved

Why does this not work?

Posted on 2014-10-22
4
123 Views
Last Modified: 2014-10-23
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
Comment
Question by:brucegust
  • 2
4 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40397334
And what exactly is not working?

Included screenshots directly in your question, don't embed them in another document.
0
 

Author Comment

by:brucegust
ID: 40397353
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
 
LVL 58

Accepted Solution

by:
Gary earned 250 total points
ID: 40397360
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
 
LVL 22

Assisted Solution

by:Snarf0001
Snarf0001 earned 250 total points
ID: 40397579
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now