3

i use jQuery datepicker. i disabled input text and wanted use it as simple calendar

http://jqueryui.com/demos/datepicker/#inline

but now i need to make it with php and mysql, so as retrieve news from database on selected date. for instance when admin adds news on 2011-07-07 i want to link this day on calendar. sorry for my bad english but if u understood please help, i really found lots of documentations but couldn't did.

i used

onselect also beforeShowDay

but cannot understand. is there any chance to make it like news calendar?

help me with a small code please...

2 Answers 2

3

Use setDate.

$('...').datepicker('setDate', date object);
Sign up to request clarification or add additional context in comments.

1 Comment

I made code $(document).ready(function(){ $("#datepicker").datepicker({ onSelect: function(dateText, inst) { window.open("?action=news_archive&date=" + dateText + "&lang=<?=$lang?>"); } } ); });
0

you can use the before show function of the date field to call a location.

$('input.dateSelect').datepicker();

then have a button that follows the input

<a href="javascript:;" title="get the new from this date!" onclick="[[call to js function]]">[ get news ]</a>

javascript function

... window.location.href = "www.foo.com/news.php?date="+$('.dateSelect').val(); ...

There is one of several ways to skin this cat, and not necessarily the best.

I hope this helps someone else with the same issues!

bo huttinger

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.