bugs: using two fields and field with required attribute
Support › MB Conditional Logic › bugs: using two fields and field with required attributeResolved
- This topic has 3 replies, 2 voices, and was last updated 5 years, 6 months ago by
Long Nguyen.
-
AuthorPosts
-
April 30, 2020 at 8:11 AM #19384
Jefferson
ParticipantHi!
How are you doing in this quarantine period? I hope well!
I have two cases in which I am encountering problems using the logical conditions:
- I have two fields that need to be displayed using the same logic. However, when I apply this to the code, the logic is not respected and all fields that have some condition are shown, even when they shouldn't be.
- I have a field where I added the required attribute. But it turns out that by default this field is not displayed and needs a logical condition to be shown. When this condition occurs, the field is shown, however I can save the post even if the field has not been filled in, which should not happen since it has the required attribute.
MY CODE:
array( 'visible' => array('status', 'in', array('scheduled','realized','review')), 'name' => 'Data da Consulta', 'id' => 'scheduled_to', 'type' => 'datetime', 'attributes' => array( 'required' => true, ), 'js_options' => array( 'stepMinute' => 15, 'showTimepicker' => true, 'controlType' => 'select', 'showButtonPanel' => false, 'oneLine' => true, ), 'inline' => false, 'timestamp' => false, 'tooltip' => array( 'icon' => 'help', 'content' => esc_html__('Se for o caso, informe a data para a qual a consulta com o cliente foi agendada.', 'mercadoterra'), 'position' => 'right', ), ), array( 'visible' => array('status', 'in', array('scheduled','realized','review')), 'name' => 'Informe o local da consulta', 'id' => 'location', 'type' => 'textarea', 'tooltip' => array( 'icon' => 'help', 'content' => esc_html__('Informe o endereço de forma detalhada onde será realizada a consulta. Caso seja na casa do cliente, informe "Em domicílio"', 'mercadoterra'), 'position' => 'right', ), ), array( 'visible' => array('status', '=', 'declined'), 'name' => 'Informe o motivo da desistência', 'id' => 'declined_by', 'type' => 'textarea', 'tooltip' => array( 'icon' => 'help', 'content' => esc_html__('O motivo não será divulgado para o cliente e servirá para que possamos melhorar nosso serviço.', 'mercadoterra'), 'position' => 'right', ), ),April 30, 2020 at 4:21 PM #19395Long Nguyen
ModeratorHi,
The problem happens because of the double quote in the content of tooltip
"Em domicílio". Please update the new version of MB Conditional Logic to v1.6.12 then check it again.Thank you.
April 30, 2020 at 7:50 PM #19397Jefferson
ParticipantHey Long!
Thanks for response. Works fine!
Now, I'm sending a screenshot of my metabox. When the fiedl are hidden a large vertical space are created because the style hidden is applied to rwmb-field and not to rwmb-row.
I believe that a feature shouldn't change the UI look that way. What do you think?
May 1, 2020 at 9:16 AM #19405Long Nguyen
ModeratorHi,
There is margin-bottom 12px of each row, see my screenshot https://cl.ly/0b63d60d6edb
Thank you for your idea, I will discuss with the developer team to improve this case.
Have a good day.
-
AuthorPosts
- You must be logged in to reply to this topic.