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...
Use setDate.
$('...').datepicker('setDate', date object);
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
[ get news ]
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
Related
I looked for answers, but I am a newbie to PhP/JQuery so the answers I found confused me further.
I have a wordpress website that contains a form with a date selector field I am trying to determine when the user selects a new date and save that date to a variable to be used somwhere else
On change doesn't work cause of the lack of focus etc...
I tried select, and that didn't do anything
In the process of trying to figur eout what I am doing wrong, I simplified the code where once it is selected it gives me a message box! the code is below:
Any help is greatly appreciated!
$JScript ="<script>
jQuery('#wdform_2_element13').on('select',function()
{
alert('Here');
}
</script>"
You can stop the process when your saving all your data from the form, and call a new function to save or do whatever you want to that variable.
You can do that by pointing your form submissions to a specific file in the wp-admin directory called admin-post.php
Take a look to this tutorial and I'm sure you will learn some basic knowledge about WP code and also the answer to your question:
https://www.sitepoint.com/handling-post-requests-the-wordpress-way/
It turns out the reason is cause the field was a date picker that was already defined through the form maker i was using. So what I did was create a date picker using Jquery, then use the "onSelect:function" and that was it
Thanks for the help
I want to be clear that I am not asking someone to write the code for me. I want to learn how to do this myself.
What I am trying to accomplish is this: I have a website where I need a user to be able to select a date and time for an appointment. What I would like to be able to do is have the user select a date from the jQuery DatePicker UI and use that selected date to dynamically populate a list of available time slots that I can display to the user so they can choose a time based on the available time slots. Similar to the way it's done on this page under step 3 - https://booking.maidsinblack.com/ .
I really want to learn this for myself, but I need a nudge in the right direction. I can get the jQuery DatePicker working on the page without an issue, but I am learning PHP/MySQL. What commands in PHP/MySQL will I need to send the chosen date from the calendar to PHP, use that to pull available times in MySQL, then send the related information back to the page for selection?
I really appreciate any help on this. Ive been searching Google for the past two hours attempting to find examples of what I am trying to do with no luck.
I have been trying to create a php form that allows you do add your employment history. I wanted it to work with javascript to add new fields such as in this link: jsfiddle.net/jaredwilli/tZPg4/4/, but with drop down lists to add a start date and end date, and then be able to POST this to php.
I am a newbie to javascript and am in need of help with this code if possible.
Thank you in advance
Am I correct in understanding that you want to add a date picker to your existing input?
If that's the case, and seeing how you're already using jQuery, you should check out jQueryUI which has a Datepicker module with great documentation.
Just wondering if anyone can point me in the directuon of some tutorial/s that
Delve into sql queries/insertions/deletions (is that a word?) using jquery and/or php.
What I was specifically wanting to do was have a button that added an entry to a table
And then the button would change or dissappear or become greyed out.
Any links that might set me on the right track would be awesome!
Thank you in advance!
http://agiletoolkit.org/intro/addons
Scroll down for a CRUD implementation using jQuery UI dialog on top of Agile Toolkit
You should use something like achieved in jQuery UI dialog modal-form.
In the other end, you just sanitize input and make modifications.
It would be awesome, if you give more exact description of what you want achieve.
OK, this sounds simple and or like something that should have probably been done a million times but i cant find an example.
I need to put a small calendar widget on a page that highlights dates if matching a date field from mysql. If user clicks this date go to a page and pass a variable like the date clicked?
Im sure this should be able to be done with jquery (datepicker maybe) and php fairly easy but im stumpped?
Any direction would be fantastic.
Try this from YUI Library