i am new to html and php i have created one railway ticket booking page in html .in that form page there are option where the user going to fill like start station,reach station and date, so how can i show date ,that is when the user click the date means it shows like a calender and the user select the appropriate date where planned to travel and i want to show next three month date from the current date like a calender. because we give permission to book the ticket before three month..so any one help me doing this in html..
and when the user select the date how can I get that selected date..
This can't be done in HTML alone, you need to use javascript, or even better, jQuery, which is a javascript library designed to simplify the creation of client-side scripts.
When using jQuery, as you can probably suspect, a lot of things already exist, including a date picker.
You can find more info on this page : http://jqueryui.com/datepicker/
I also encourage you to check out the other contents the jQuery UI site, as they are really useful to easily design richer forms.
Related
I want to create repeating Events like gmail. IF any idea, Please let me know? Thanks in advance.
You can setup/install the Date module on your site. Then, in the Event content type, configure your event date field with the repeat option enabled (see screenshot in Lullabot's blog post about the date module)
Also, here are a few considerations about dates during your Event content type and views setup process:
Once you configure the date field and add event content with those fields defined, you won't be able to modify the field settings to a more restrictive state. (For example, if you enable repeat and then decide to disable repeat). A work around for this is to create a new date field with desired settings, use views bulk operations to copy the data from obsolete date field to new date field, then delete obsolete date field.)
When working with repeating or ongoing events, you'll need to determine how you want them to appear in chronological event listing views. (For example, ongoing events may wind up showing at top of list if your sort is based only on start date. If your view is limited to very few listings/results, and all your events repeat- make sure there's enough variety of events to avoid showing the same repeating event back to back in the view. You may want to consider showing only distinct results in the view.)
When working with repeating dates, do the times also repeat? If not, you may want to also install the Node Clone module and configure so content managers can copy event nodes and edit/modify times.
If showing times, do you need to show timezones associated with them?
so my problem is this. I use the multi datepicker, http://multidatespickr.sourceforge.net/
for a site with news block. i save multiple dates for 1 news item and it works like a charm with php. BUT now my problem is, if someone wants to edit the news , I do get the current dates the news has, in a input field, but that isn't marked on the multi datepicker. problem here is, if they selected 30 dates, and want to exclude one after editing, they have to pick 29 dates again on datepicker, cause they wouldn't be active otherwise. my question here is, is there any way to make the datepicker get the dates from an input field ? FYI I get the same date formats both on getting and selecting from datepicker.
You'll have to show the context in which you use it, but the addDates parameter looks like it does what you want, so on instantiation you would pick up the list of dates from your input field and supply them in this parameter. See also how to pre-select dates.
I'm surprised the datepicker isn't permanently alive and just shows itself, in which case it would know what state it was in from last time it was hidden.
Update: reading even further it seems it uses the dates from an input field anyway. See this demo further in the instructions
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 am implementing a data recordset table.
I would like to create 2 radio buttons for user selects the option to control my data table.
For example, the radio buttons are: (imagine the interface as describe below)
- View by Month: ['month' drop-down list] - ['year' drop-down list]
- View by Date: Start Date: [date picker] to End Date: [date picker]
If my customer want to view the table with March only. He needs to select [View by Month] radio button, and then select month and year drop-down list.
If my customer want to view certain date of periods, she needs to select [View by Date] radio button, and then pick the date on the box (I assume Javascript
I have search round the Q&A in stackoverflow, but have no idea which one suitable to implement into my codes that written in PHP, I have no Javascript nor jQuery knowledge, I hope can get a simplest solution.
I want to pass this parameter to a URL and retrieve the data recordset onto my page.
You would either have to use Javascript to take the values of the select inputs and generate an Ajax request to build the correct results
or
Turn the options into a proper form and provide a submit button which will post the values to a particular script which will build the results and then render the same page containing the amended results.
Check out jQuery. The docs are fairly straight forward and will give you a good opportunity to see how to achieve even more awesome stuff using javascript.
i am using jquery date and time picker in one my project where users can create an event. in the jquery datepicker, i have the option to select the today's date and future date and not the past date which is good for an event creattion website. but i am stuck with the time picker. for example, if i am in the event creation page(assume now time is 9.30am) and select date as 2010-08-05, then i click on the time field but the time field shows time that is already past i.e. time before 9.30, i cannot allow user to choose time that is before the current time. how can i valdiate this? or is there any way not to show the past time?
I am using php, if i decide to validate using php, how i am supposed to validate, which time I should use as base to check the user selected time? users can come from any country so how i am supposed to know which is past time for an user.
I use this http://labs.perifer.se/timedatepicker/, I use the first option and I can use the last option where users allowed to enter two fields which is good as we can know the duration and good thing is second field works based on the i/p in the first field but still this doesnt solve my past time issue.
please let me know if i am not clear.
regards
>> users can come from any country so how i am supposed to know which is past time for an user.
If I understand you well, the best way is to check at the client side(in javascript).
Here is the sample code .
$("#time").timePicker({
startTime:new Date() // pass the current time
});
Then, the timePicker will omit the past and start from the current time.