Skip Navigation

[Resolved] How to prefill default value in dropdown box?

This support ticket is created 5 years, 11 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 8 replies, has 2 voices.

Last updated by Shane 5 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#1188042

Tell us what you are trying to do?
i want to a view to be opened with a custom value that appears in the url parameters
I tried this:
https://toolset.com/forums/topic/how-to-prefill-default-value-in-dropdown-box/

the link to my site where the view is:
hidden link

#1188150

Shane
Supporter

Languages: English (English )

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

Hi Meirk,

Thank you for contacting our support forum.

Actually this is possible. Is this a Parametric search or a regular view?

If it is a regular view then you can just add your filter to the view and then set it to get its parameter from a url attribute then you can just pass the info into the url
https://toolset.com/documentation/user-guides/passing-arguments-to-views/#filters-by-custom-fields
Please let me know if this helps.
Thanks,
Shane

#1189282

its a parametric search
But i need to add the parameter in the url string from html (any ajaz or js)

#1189793

Shane
Supporter

Languages: English (English )

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

Hi Meirk,

Is the view clicked to from somewhere ?

Meaning does the user have to click on a specific link or a fixed link to get to the page that lists the view ?

If so then you can add the url Parameter to the link directly.

Please let me know.

Thanks,
Shane

#1189936

I cannot write in href from other page.
I need to aplly this url params automaticaly after a form has been submited

#1190760

Shane
Supporter

Languages: English (English )

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

Hi Meirk,

What kind of form ?

Could you let me know where the search is being clicked to ?

I mean the page that you click to get to the form.

Thanks,
Shane

#1190778

It doesn't matter the previous page who links to this page as i need to add params to url according to the form fields typed in the user form at the present page

#1190955

I see we are going around ourselves - would like to get an answer or please pass me to other supporter - thanks

#1191269

Shane
Supporter

Languages: English (English )

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

Hi Meirk,

Unfortunately, i'm the only one available today. Perhaps I can ask christian to assist with this, however he won't be available until sunday.

I took a look at the link you sent but this isn't working.

I understand what you want to achieve but what i'm not understanding is the use case. Is the user form on a separate page from the parametric search form ?

You say it depends on a value that the user selects in the user form. We have hooks that we can use to get that value they select and redirect to the form with that value in the URL.

I just need to know the page that the user form is on and the page that the search form is on and the field that will be setting the value in the URL.

Thanks,
Shane