diafol
Keep Smiling
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57
> Problem might be that it is so complicated that I won't have time to learn enough to implement it where(when) it is needed.
The whole point of it is that it's NOT complicated. jQuery certainly makes using js a lot easier. You just link to the jquery.js and jqueryui.js files and copy the js and html from the jqueryui example page. That's it, you're done. :)
diafol
Keep Smiling
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57
Don't feel dumb - if you have no experience of it, you can't be expected to get it straight away. Anyway -
I tend to use the Google CDN for linking to jquery from here:
http://code.google.com/apis/libraries/devguide.html#jquery
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
I tend to download jqueryui and put it on the server. Easy enough - choose your theme and unzip to a folder of your choice - rename the folder though to something simple like 'jui'. I also rename the jqueryui.js file itself as this tends to have the version number in it - probably not the wisest thing to do, but I'm a cack-monkey-handed typer and always mistype the dots and numbers! :)
BTW - use the minified js file (...min.js) - it's faster.
Then lets say your file is: /jui/jqueryui.min.js, just palce another script tag UNDER the jquery one:
<script src="jui/jqueryui.min.js"></script>
You should now be all set up once you link in the CSS files. I tend to maove all the css and image files to my main css folder. Again I rename the jqueryui*.css file to jui.css for ease.
<!--your own custom css file if you have one -->
<link href="css/main.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" />
<!--the moved and renamed jqueryui css file-->
<link href="css/jui.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" />
So now, you should have:
<link href="css/main.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" />
<!--the moved and renamed jqueryui css file-->
<link href="css/jui.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" /><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="jui/jqueryui.min.js"></script>
Then follow the instructions for use. If you need the date range:
Go to the http://jqueryui.com/demos/datepicker/#date-range page and click on the 'view source' link. Copy the code and paste the script into the head area (below the jqueryui.js - or whatever you called it - script tag) and the form into the body area. Should be good to go.
diafol
Keep Smiling
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57
you don't need to reference core and datepicker.
Also check the css file for the location of the image files. They should be relative references to the css file., e.g.
.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url([B]images/ui-bg_highlight-soft_100_eeeeee_1x100.png[/B]) 50% top repeat-x; color: #333333; }
Search for image in your text editor and change the urls as required.
diafol
Keep Smiling
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57
<script type="text/javascript">
<script>
$(function() {
var dates = $( "#from, #to" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
});
});
</script>
Get rid of that extra open script tag - no need for it - it's stopping code execution.
diafol
Keep Smiling
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57
Question Answered as of 1 Year Ago by
diafol