Arrival/departure dates

User 2702417 Photo


Registered User
4 posts

I'm trying to build forms and so far everything is going really well.

There's just one thing that I'm not sure if it's possible ...

I wish to have two date fields for a hotel booking system. There will be an arrival and a departure date. Is there any way that the form can check the departure date is after the arrival date? It would be really handy if the default for the departure date set itself to the arrival date the customer entered. I've seen this done in some places, and wonder if it can be done here. I've tried asking support and they say it's not a feature that is incorporated yet, but they have seen some people make mods to allow for this.

Any help anyone can offer would be appreciated

Thanks

Guy
User 187934 Photo


Senior Advisor
20,190 posts

This should be able to be done by adding a script. Give me a while and I'll take a look at it when I get a chance.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,190 posts

This seems to work.
http://ericrohloff.com/coffeecup/ccforu … atepicker/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2702417 Photo


Registered User
4 posts

Really brilliant thanks. It does exactly what I needed it to. Now all I need pretty please is the script and how or where I use it. You can email guy@rainbowwebsitedesign.com or when I am back on my laptop I will try to see the code on your page.

Thanks again

Guy
User 187934 Photo


Senior Advisor
20,190 posts

Instructions are on there.;)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2702417 Photo


Registered User
4 posts

Thanks again.

I've had a good try to implement this - please see http://www.rainbowwebsitedesign.com/boo … oking.html

I've done what you told me (I think), added the script to the booking.html, changed the two datepicker lines to be
<input name="dt1" class="datepicker" id="dt1" required type="text" data-hint="" />
and "dt2" and added the two .js files to the http://www.rainbowwebsitedesign.com/booking directory. However as you can see from the form, it's not working.

Could I trouble you for two minutes more of your time to see where I've gone wrong. It's such a perfect addition and you've made it work on your sample that I really do want to get it right

Thanks again

Guy

User 2702417 Photo


Registered User
4 posts

I've done it. I made two simple errors and have corrected both. The .js files should have been one directory higher (I've changed your script to allow them in the same directory) and there was a problem with the date formatting. I wasn't using mm/dd/yy

Now it works 100% perfectly and I'm really grateful

Regards and many thanks

Guy
User 362156 Photo


Registered User
46 posts

Eric, thank you for this script! I have added it to a form where clients book transfers from/to the airport and it works great! We are using date format D, dd M yy.

Thanks again,
Johan
User 187934 Photo


Senior Advisor
20,190 posts

Great! The best part of the form builder is that you can use it to make a form but still easily alter it to fit your needs. I pleased that you were able to figure the needed date format out on your own.:cool:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 122279 Photo


Senior Advisor
14,454 posts

I have also implemented that script in a couple of forms. :) So thanks from me too!
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.