Solved

Why does this not work?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery detect if it is a mobile device 3 90
html form to write data to csv 24 95
Google Sheets Script 21 51
Check if Object property exists? 3 18
This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

932 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

10 Experts available now in Live!

Get 1:1 Help Now