integration with a form

Help with installation and general calendar setttings

Re: integration with a form

Postby chris » Tue Sep 06, 2011 10:15 am

Hi,
In this thread from some months ago I included the JavaScript code to disable (hide) the "back" button.
However in that post I didn't actually explain the steps required as there was quite a few of them.
This is fine if you haven't modified your JavaScript file however in your case I think that you have as you mention that you have integrated it into a form.
So, before replacing your JS code with the code in that thread, remember to backup your current file with your modifications and then to copy them over to the modified version.

I'm afraid I can't help you out with the Wordpress side of things as I don't do much work with Wordpress.

Chris
User avatar
chris
Site Admin
 
Posts: 1088
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: integration with a form, date formats

Postby Razoredger » Thu Mar 08, 2012 2:10 am

Hi,
I have got the iframe filling start and end dates on my form but it displays the date switched backwards. On mouseover, the calender shows the correct format d/m/y but then in the form box it becomes --> y/m/d.
This is very confusing.
I have spent hours scrutinizing codes and tried many php, even sql, no luck. Once the date is picked the php is overrided by the mootools script and it turns the date around.

Would there be a code I could pass in mootools-cal-public.js to keep the date format as specified in ajax calender admin?

Please, help! I am stumped. :?:
User avatar
Razoredger
 
Posts: 12
Joined: Tue Aug 30, 2011 4:09 pm
Location: Indian Rocks Beach

Re: integration with a form

Postby chris » Thu Mar 08, 2012 10:22 am

Hi,
The date isn't being changed by the JavaScript.
The attribute that the JavaScript uses to get the date already has the date in that format as that is the simplest/best format for inserting the date into the database.

I presume that you are using a version prior to v3.04.06. Is that correct?

If so you can make the following changes:

1. In file ac-includes > functions.inc.php find this line (158):
Code: Select all
<li class="'.$day_classes.' "  id="'.$date_db.'" title="'.$date_format.$day_title_state.'">'.$day_counter.'</li>';

and replace it with this:
Code: Select all
<li class="'.$day_classes.' "  id="'.$date_db.'" title="'.$date_format.$day_title_state.'" data-date="'.$date_format.'">'.$day_counter.'</li>';

Then open your ac-includes > js > mootools-cal-public.js file and, within the function that you have modified to get the dates when clicked on (I assume your code is based on what was posted earlier in this thread) change this line:
Code: Select all
dateStart.set('value',this.id);

to this:
Code: Select all
dateStart.set('value',this.get('data-date'));


Let me know how it goes.

Chris
User avatar
chris
Site Admin
 
Posts: 1088
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: integration with a form

Postby Razoredger » Thu Mar 08, 2012 9:31 pm

:D Thanks! You saved my sanity!

In answer to your questions, my version is 3.03. all in an iframe. I used the clickable dates code which included dateStart and dateEnd.

With your suggested modifications all works great.

One last question, how can i get the month to display in words? I've tried M, MM mo...???
User avatar
Razoredger
 
Posts: 12
Joined: Tue Aug 30, 2011 4:09 pm
Location: Indian Rocks Beach

Re: integration with a form

Postby sjaak076 » Wed Mar 14, 2012 10:16 am

Hi,

It's a very good script, but I have a question.
What I want is, a form with two data input fields.
If you clickon one input field, than opens a popup.
For the second input field the same.
In the popup can you than select the correct date.
How can I make it?

Sorry for my bad English.
sjaak076
 
Posts: 2
Joined: Wed Mar 14, 2012 10:08 am

Re: integration with a form

Postby chris » Wed Mar 14, 2012 10:32 am

Hi,
It sounds like you need a date-picker script rather than this availability script.
A quick search on Google you should give plenty of scripts and demos.

Chris
User avatar
chris
Site Admin
 
Posts: 1088
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: integration with a form

Postby sjaak076 » Wed Mar 14, 2012 10:52 am

I would like the data-picker with this script, so you can see which date are reserved.
sjaak076
 
Posts: 2
Joined: Wed Mar 14, 2012 10:08 am

Re: integration with a form

Postby chris » Wed Mar 14, 2012 3:05 pm

Ah, I see.
So you will need to do this with JavaScript to convert the calendar <div> into a hidden element that you can show when you click on the date field elements.
I'm afraid that this sort of thing falls well beyond the scope of this forum.

Feel free to contact me directly via the contact form on the main site if this is something that you may want me to do for you as a custom project.

Chris
User avatar
chris
Site Admin
 
Posts: 1088
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: integration with a form

Postby floep » Tue Apr 17, 2012 10:00 am

Hi, thanks for this great calendar.
I just have 1 smal problem which i cant seem to fix. I integrated the calendar in a form but when i change the options, it submits the main form. I tried by giving the form an id, but then it doesn't load a new calendar. You can check it out on
www.houseboat-potomac.com/booking1.php :D
floep
 
Posts: 1
Joined: Fri Apr 06, 2012 1:26 pm

Re: integration with a form

Postby chris » Tue Apr 17, 2012 8:36 pm

Hi,
You can't embed forms within forms.
You need to take the calendar out of the main form and position it with css as required.

Chris
User avatar
chris
Site Admin
 
Posts: 1088
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

PreviousNext

Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron