- This topic has 3 replies, 2 voices, and was last updated 9 months ago by .
-
Topic
-
Hi!
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', ), ),
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.