Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Jimmy Smutek
seal-mask
.a{fill-rule:evenodd;}techdegree
Jimmy Smutek
Python Web Development Techdegree Student 6,629 Points

Date select registration form conundrum

This is kind of crazy, I think....

I am trying to build a signup form for a wordpress site that I am ohhh so close to being finished with.

The user needs to be able to select multiple dates from a calendar. Ideally this will not behave like jquery date picker but, rather, the user will see a calendar on their screen. They click on the dates they want, the dates are highlighted.

On click the date(s) selected get passed to a form. If the user decides to deselect a date, they just click on the highlighted date and the deselected date gets pulled from the form.

To complicate things, the calendar presented to the end user should always show the current month - but the days available for selection must be limited to Monday - Thursday.

At the bottom of this form are fields for the user to add contact data, and on form submission an email is sent to the site administrator with all of the submitted data. This part is no problem as I have a gravity forms license and have been using that for my forms.

Added bonus - the form counts how many days have been picked, and passes that value to a quantity field, so that I can tie it into a check out.

Uggh.

As mentioned, I have a gravity forms license. I've read through the documentation for the gravity forms date field, but I don't see a way to use it to solve my specific problem.

The thing that sucks about this is that I have a project ready to launch and this is the one thing that is holding me up. I kind of put my foot in my mouth when I told my client "sure, I can do that". I didn't really think it through.

I mean, unless I am missing something, I just don't think this is going to happen. Obviously it isn't impossible - but I'm outside of both my skill set and my scope here, and on the edge of my deadline.

Thankfully - the client knows that this is a bit outside of the agreed scope, so, worst case scenario (and I think I'm there, in the worst case scenario zone), I will just do a form and let the user free write the dates in.

I just thought I'd post up here and see what sort of feedback I get. At this point I haven't even been able to find an example of a calendar that will do what I need it to do - just some sort of js calendar with clickable days. If I can find that, I know how to implement it in my theme, and I can probably find a way to pass the values to gravityforms.... but again, scope creep.... budget.... deadline....

Blah, drat! Thanks for reading...

2 Answers

This is probably the best datepicker i've used (that I can remember anyway) http://keith-wood.name/datepick.html You could definitely do it with that, although if I remember correctly it's a bit of a pain to style.

If your using Gravity Forms, then I'm not 100% sure how you'd hook that into the registration form. I'm sure it's do-able, I just have never done it. However if you wanna hook into the registration form without using Gravity Forms you'll need the following hooks:

register_form registration_errors user_register

It's fairly easy to do when you know how to, it's just a case of adding the fields to the first hook, validating the data in the second hook, and then saving the data in the third hook. That's it, done.

Hopefully you can work it out from this link, or someone else can expand on this and perhaps give a better Gravity Forms integrated example?

Good Luck :)

Jimmy Smutek
seal-mask
.a{fill-rule:evenodd;}techdegree
Jimmy Smutek
Python Web Development Techdegree Student 6,629 Points

Hey Christopher - thanks for your response, good stuff!

I found this calendar last night, this is the type of thing I am going for, except the user should be able to select multiple days on the calendar.

http://www.vissit.com/projects/eventCalendar/

I spoke with my client today, however, and it looks like it is all for naught, and they had intended to re-think and simplify this form a bit. Apparently I didn't get the memo.

I still think I am going to grab that calendar and see if I can't put together some sort of solution for this.