Skip Navigation

[Resolved] How do I set up a datepicker field to pass a URL parameter with the selection?

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 11 replies, has 2 voices.

Last updated by Shane 6 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#913951

Tell us what you are trying to do?

I need a datepicker field that can pass a parameter *into* the URL. I can't find the documentation to set up the form required for this.

Is there any documentation that you are following?

I have successfully set up a search results view that filters by a taxonomy category and date (all passed in via querystring). The date that is passed in is used to filter the results by two fields on the type "event from" and "event to" (because events span multiple days)
I've spotted this comment in another support thread that I'd like more information on: https://toolset.com/forums/topic/datepicker-styling/#post-586436

" The Query Filter was set to filter dates greater than or equal to TODAY(), but you should really be responding to a URL parameter instead. This allows you to respond to the changes your user makes in the datepicker field, which get passed into the URL parameter. "

^ this sounds like what I want but I'm not sure how to go about setting it up.

The input form of the search view will be shown in a sidebar widget (displaying a textbox, a category list, and a datepicker field) and then will load the results up like this :

hidden link
or
hidden link

But I don't know how to get the controls to a) display and b) post the correct url variables to the querystring

My view has all the query filters set up, as well as the loop and content template. But I'm stuck on knowing what to click on in the filter controls to get the result I want.

Thanks in advance!

#914007

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mel,

Thank you for contacting our support forum.

Is it that you want to setup a parametric search using date filters?

Please let me know.
Thanks,
Shane

#914015

Maybe?

I want to have a single datepicker that I can pick up on another results page and make sure that it's with a range of two date fields on my type (I have the query filters working, but not sure of how to get the controls to display and send the info I want)

Thanks

#914056

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mel,

Actually you can create a parametric search with the datepicker and separate the filter section from the view.

So you can have the datepicker on a separate page and filter the view on another page when its clicked.

All you need to do is when you're adding the view to the page just select on search filter.

Thanks,
Shane

#914751

OK thanks, do you have a link to the docs where it explains how to do the set up and separation?

#914803

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mel,

Actually we do and you can have a look here.
https://toolset.com/documentation/user-guides/front-page-filters/#4-1-adding-the-custom-search-form-to-a-page-or-widget

Please let me know if this helps.
Thanks,
Shane

#915189

I need more help than this (but thank you for the link)

How do I add a datepicker filter that I can then use to search two fields? Can you walk me through what I need to do?

The docs only have examples of filtering a particular, single field, I can't get it to work for what I'm trying to achieve (details are in my first post on this thread) but I must be missing something simple.

I just want to add a datepicker field, that will send it's value to the url (somehow?) It must be possible as the other tech support person (Christian Cox) mentioned it in that other thread I linked to.

#915358

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mel,

You want the datepicker to target 2 separate date fields ?

Or do you want 2 different datepickers.

#915373

* I have a type called Event
* It has a field called Event_From
* It has a field called Event_To

This is because an event can span several days.

The most basic type of search I want is for the user to select a date with a single datepicker, and for the search to return events that are happening on that day.

I want the user to be able to select this date from a sidebar widget, and it load up a results page.

(As I haven't been having much luck on this thread, I've been experimenting with view paramters and custom shortcodes to get what I need out of the querystring. but I'd still like an answer to my question as I am sure if I could make you understand what I'm doing there's probably a simple answer!)

If you could provide code suggestions that would be very helpful. Thanks!

#915451

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mel,

Would you mind providing me with admin access to the website so that I can help with this ?

The private fields have been enabled for your next response.

Thanks,
Shane

#915641

What exactly will you be accessing / changing if you have admin access? If you set up a new search etc then that should be OK but I don't want you to change what's currently set up.

#916706

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mel,

I would create a duplicate of the view.

Could you let me know the exact view so that I can have a look ?

Thanks,
Shane