Skip Navigation

[Resolved] click submit – show query results separate page

This support ticket is created 4 years, 2 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 20 replies, has 3 voices.

Last updated by davidm-13 4 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1846539

Shane
Supporter

Languages: English (English )

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

Hi David,

Unfortunately you won't be able to limit this dropdown list.

I've searched for references on how to do it but wasn't able to find anything specifically for the dropdown options.

Thanks,
Shane

#1846567

Thanks Shane apprecate all your help

#1846585

Hi Shane,
found this:
https://stackoverflow.com/questions/8788245/how-can-i-limit-the-visible-options-in-an-html-select-dropdown

Is this something I can use? Where would I put the onmousedown code?

Thanks

#1846615

Shane
Supporter

Languages: English (English )

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

Hi david,

It is not an elegant solution but you can do it like this based on the code you've sent.

jQuery('select').attr("onmousedown","if(this.options.length>8){this.size=8;}");
#1846729
select-jquery.jpg

Thanks Shane,
I've inserted

jQuery('select').attr("onmousedown","if(this.options.length>8){this.size=8;}");

into the JS Editor section, which results in attached image.
Is there any way to add all of the snippet from the example

onmousedown="if(this.options.length>8){this.size=8;}"  onchange='this.size=0;' onblur="this.size=0;">

So that onchange or onblur the list dropdown closes.

Thanks

#1847011

Hi Shane,
Problem solved added to JSEditor

jQuery('select').attr("onmousedown","if(this.options.length>8){this.size=8;}");
jQuery('select').attr("onchange","this.size=0");
jQuery('select').attr("onblur","this.size=0");

Thanks for your help, couldn't have done it without you.
David