Skip Navigation

[Resolved] How to set default value of radios filter in view

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display selected radio button by default with view's filter

Solution:
You can use javascript/jQuery and add it to view's filter's JS box to set radio button selected.

You can find proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/how-to-set-default-value-of-radios-filter-in-view/#post-724553

Relevant Documentation:

This support ticket is created 6 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by insooJ 6 years ago.

Assisted by: Minesh.

Author
Posts
#722783
senavi.PNG

Tell us what you are trying to do?
I am making custom field filter of radios type.
On loading the page none of radios is selected but I'd like to set a spacial value default selected.
How can I do?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#723499

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand - you want to display specific radio as selected when you load the view first time - correct? If so - could you please share problem URL so I can look at the radio name etc..etc.. and get all information I needed.

#723756

Thank you for your quick reply.

The url is hidden link.
The Korean character may hinder your understand.

Best regards,

Insoo

#724553

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please try to add following code to your view's filter section's JS box:

jQuery(document).ready(function($){
  $('#form-5261611a1156bf4c3d08181fc9e036cb-1').attr('checked', true).trigger('change');
});

Does this help to resolve your issue?

#725325

Thank you Minesh

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.