Solved

Why does this not work?

Posted on 2014-10-22
4
127 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to dynamically set the form action using jQuery.
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…

820 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