Forum Replies Created
-
AuthorPosts
-
Yasmine
ParticipantOk question number 2 you can ignore -query_args!
But still stuck on number one, especially as I read they are only supposed to show the parent until clicked, exactly what I want.
Yasmine
ParticipantSo typical! After despairing for over an hour, as soon as I send this I realise I had the value in
'name' =>not'std' =>Although, I still feel I should have been able to have targeted those labels within the custom_html field to be ignored using the css
Yasmine
ParticipantThis issue has taken me too much time, so I am finding a workaround and giving up.
But I able to work in the original Conditional Logic code - as if I can then I can just modify my needs there so no conflict. If so, how can I do that
Yasmine
ParticipantThey are hidden by the tab pages eg:
$('.form-nav').on('click', function(e) { e.preventDefault(); $('.rwmb-tab-panel').hide(); var targetPanel = $(this).data('target'); $('.rwmb-tab-panel-' + targetPanel).show(); });$('body').on('click', '.ref-nav', function(e) {
e.preventDefault();
let currentGroup = $(this).closest('.rwmb-group-clone');
let sectionToHide = '.' + $(this).attr('data-current');
let sectionToShow = '.' + $(this).attr('data-target-group');
let sectionToPopulate = $(this).attr('data-target-group');currentGroup.find(sectionToHide).hide();
currentGroup.find(sectionToShow).show();
});`But not by another field as per the issue on the other topic. The
custom_selectionis a hidden field thats only purpose is to update so I can use that value. Andacademicoutputhas no other conditional logic to determine its visibility beyond the page logic. Is that what you mean by nested? Or do you mean because it is a group field?I also tried using a custom callback to set my own conditional logic and that wouldn't work either...
Yasmine
ParticipantAnd just to take a step back at the bigger issue, as this is what Im really trying to solve:
I have made some navigatable sections on a cloneable group field. Currently (and when I only have one conditional logic condition), when the value is selected, it shows beneath the first page - despite having CSS there hiding its class. So I added an additional condition, which I want just to keep it hidden until you reach the page. This is governed by a hidden field that is populated by js. The value is correct. However, this lead to the issue of conditional logic not being triggered when a field is populated automatically. And it also did not fix my problem of keeping the field hidden until the right moment in the form.
Yasmine
ParticipantHi, I went into the builder and used the builder to create my conditional logic so I could ensure I had the right format. I then copied this format across eg
'visible' => [ 'when' => [['academicoutput', 'in', ['9212', '13304']], ['current_selection', '=', 'ref_p10-4']], 'relation' => 'and',] ],But I still have two issues:
1. Populating a field automatically with js does not trigger the conditional logic. You need to go in and retype a letter and then it happens.
2. Why does it not work correctly when there are two conditions?? You shared with me documentation about how to have multiple conditions, and I have made sure I used the exact format, so I really don't get it.
But I just want an answer to how I can get this working. What exactly do I need to do?
Yasmine
ParticipantThanks, that was exactly what I needed. Its perfect now.
Yasmine
ParticipantOk great. So how do I navigate this issue? What do I need to do?
Yasmine
ParticipantYes, the issue is still there when I remove the array('current_selection', =, 'ref_p10-4').
The only reason I added it as an additional condition, was to try and get rid of this issue.
I also don't understand what you mean, the documentation you shared says that you can add multiple conditions? And I believe I followed the documentation?
October 25, 2023 at 4:10 AM in reply to: [Feature Request] Conditionally Set Value Of Field Based On Value Of Another #43607Yasmine
ParticipantWS Forms lets you do this very well, it would be great to add that functionality to native metabox
Yasmine
Participant+1 - very, very needed for my form.
Yasmine
ParticipantSure thing: https://jam.dev/c/babc47aa-8cc7-4bec-9995-3830a6fda469
I do have a multistep, but it should be hiding the classes unless on that class. I also added the condition that the field should only show when
'visible' => array( 'when' => array( array( array('academicoutput', 9212), array('academicoutput', 13304), 'relation' => 'or' ), array('current_selection', 'ref_p10-4') ), 'relation' => 'and' ),But it was showing (as you can see in video) when
current_selection','=', 'ref_p10-1'Yasmine
ParticipantThanks I know how to add CSS. But was wondering how I can put the button in the HTML so that it is in same div as the current submit button. How do I edit the main html form for elements such as the default metabox submit button
Yasmine
ParticipantWith the hide from frontend, that hides full metabox groups and so you need to have it [block A - for x user], [block B - for y user], [block C - for all users]
Instead I have it:
field 1 - for all
field 2 - for x user
field 3 - for y user
field 4 - for allSo it is embedded. There seems to be no conditional logic for user_role per field, so wanting to understand how can best achieve that. Unless I got it wrong with the Include Exclude.
Yasmine
ParticipantFor this, if you create a separate field group with advanced location rules but then embedded those fields into the same form (eg in a php file), under a different field group ID, then would the advanced location rules still apply?
-
AuthorPosts