Is there a good Calendar script, that can post via PHP?
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Is there a good Calendar script, that can post via PHP?
I am looking at adding a simple calendar to a webpage, so people can select the date, and then select a time, and submit so the information is passed over thru a PHP variable to a form.
It's so people can submit a preliminary booking date and time.
I know there isn't a PHP Calendar, as PHP is server side rather than that - but is there a nice neat calendar that is commonly used, that can be wide or small (and responsive), so that when it's select and 'submitted', it passes over that date?
It's so people can submit a preliminary booking date and time.
I know there isn't a PHP Calendar, as PHP is server side rather than that - but is there a nice neat calendar that is commonly used, that can be wide or small (and responsive), so that when it's select and 'submitted', it passes over that date?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good Calendar script, that can post via PHP?
This might work, but not sure how to put their date (that appears in the Span) into a variable for submission:
https://yuilibrary.com/yui/docs/calenda ... imple.html
https://yuilibrary.com/yui/docs/calenda ... imple.html
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good Calendar script, that can post via PHP?
datepicker is fairly popular.
For that YUI thing it looks like you're supposed to listen for the selectionChange event and update some hidden form element with the date.
For that YUI thing it looks like you're supposed to listen for the selectionChange event and update some hidden form element with the date.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good Calendar script, that can post via PHP?
oh date picker looks good.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good Calendar script, that can post via PHP?
Is there a way I can alter the format of it, so it's dd/mm/yyyy, as that's how we do it in the UK...?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good Calendar script, that can post via PHP?
datepicker? Yeah, it should be one of the options.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good Calendar script, that can post via PHP?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good Calendar script, that can post via PHP?
<script>
$( function() {
$( "#datepicker" ).datepicker();
} );
$( ".selector" ).datepicker({
dateFormat: "dd-mm-yy"
});
</script>
Is this not correct?
$( function() {
$( "#datepicker" ).datepicker();
} );
$( ".selector" ).datepicker({
dateFormat: "dd-mm-yy"
});
</script>
Is this not correct?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good Calendar script, that can post via PHP?
Does it do what you want? I'm guessing not.
You do have jQuery and UI in the first place, right? Are you familiar with how jQuery works? Because just copying stuff from the documentation isn't going to work.
You do have jQuery and UI in the first place, right? Are you familiar with how jQuery works? Because just copying stuff from the documentation isn't going to work.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good Calendar script, that can post via PHP?
This is what I have at the moment:
And this is the part of the form:
And no, the date still comes up month first.
Code: Select all
<script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#datepicker" ).datepicker();
} );
$( ".selector" ).datepicker({
dateFormat: "dd-mm-yy"
});
$(document).on('change', '.div-toggle', function() {
var target = $(this).data('target');
var show = $("option:selected", this).data('show');
$(target).children().addClass('hide');
$(show).removeClass('hide');
});
$(document).ready(function(){
$('.div-toggle').trigger('change');
});
</script>Code: Select all
<div class='book-left'>Preferred Date:</div>
<div class='book-right'><input type="text" name='date' id="datepicker" placeholder='Click to choose date'></div>
<div style='clear: both'></div>Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good Calendar script, that can post via PHP?
Code: Select all
$( ".selector" ).datepicker({
dateFormat: "dd-mm-yy"
});-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good Calendar script, that can post via PHP?
But it's called datepicker?
<input type="text" name='date' id="datepicker" placeholder='Click to choose date'>.
Do you mean like this?
<input type="text" name='date' class='selector' id="datepicker" placeholder='Click to choose date'>
<input type="text" name='date' id="datepicker" placeholder='Click to choose date'>.
Do you mean like this?
<input type="text" name='date' class='selector' id="datepicker" placeholder='Click to choose date'>
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good Calendar script, that can post via PHP?
So
Are you familiar with any UI libraries? I know you found a date thing for YUI, however that project is dead so it isn't the best thing to choose.
no.requinix wrote:Are you familiar with how jQuery works?
Are you familiar with any UI libraries? I know you found a date thing for YUI, however that project is dead so it isn't the best thing to choose.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good Calendar script, that can post via PHP?
So is that one a bit of a bad one to use then? I just want to have the date field correct.
I'm not familiar with UI libraries.
I'm not familiar with UI libraries.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good Calendar script, that can post via PHP?
It's fine to use, but if you don't know jQuery then you'll have to learn it.
(sigh)
What's your HTML for the form? Specifically, the inputs where the date and time are supposed to go.
(sigh)
What's your HTML for the form? Specifically, the inputs where the date and time are supposed to go.