Skip Navigation

[Resolved] Can i recive help in chat please?

This support ticket is created 5 years, 10 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

Author
Posts
#1196601

I need help for issues

#1196665

Hi Antonio,

Thank you for waiting.

1. To insert an empty first select option in the taxonomy dropdown selector field, you can add following custom script in the "JS editor" tab:
( example screenshot: hidden link )


jQuery(document).ready(function($){
  
jQuery("select[name='project-type[]']").prepend('<option value="0">- Select -</option>');
jQuery("select[name='project-type[]']")[0].selectedIndex = 0;
  
});

Important note: Please replace "project-type" with the actual taxonomy field name, used in your form.

2. As Nigel explained in his reply ( https://toolset.com/forums/topic/when-select-category-i-want-automatic-change-field-based-on-my-conditional-set/#post-1196644 ), the conditional block for the taxonomy field check will need to be constructed manually.

Here is a simple example of a frontend form to make it more clear:
screenshot: hidden link

As can be seen in the screenshot, there is a taxonomy field "Project Types" based on which I'd like to show or hide the other two fields "Project Field 1" and "Project Field 2".

To make the "Project Field 1" show, only if "Project Type 1" is selected in the Project Types" field, I'll wrap it in a condition like this:

Without condition:


<div class="form-group">
<label>Project Field 1</label>
[cred_field field="project-field-1" force_type="field" class="form-control" output="bootstrap"]
</div>

With condition:


[cred_show_group if="( $(project-type) eq '32' )" mode="fade-slide"]
<div class="form-group">
<label>Project Field 1</label>
[cred_field field="project-field-1" force_type="field" class="form-control" output="bootstrap"]
</div>
[/cred_show_group]

As a result, the field "Project Field 1" will only show, if and when the user will select "Project Type 1" (with taxonomy ID 32), from the "Project Types" field on top.

Similarly, I can wrap the second field "Project Field 2" in a similar condition, but with a term "Project Type 2" (with taxonomy ID 33):


[cred_show_group if="( $(project-type) eq '33' )" mode="fade-slide"]
<div class="form-group">
<label>Project Field 2</label>
[cred_field field="project-field-2" force_type="field" class="form-control" output="bootstrap"]
</div>
[/cred_show_group]

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1196679

My issue is resolved now. Thank you!