11 years ago
9
Topic

How can I mix on a single field two behaviors:

1- TOTO field shoud be active only if another TRIGGER field is set to 1 (with a conditional state I guess, that's easy)

2- make the TOTO field mandatory

The problem is when Trigger is set to 0: then the TOTO field is inactive BUT still mandatory !! so you can't submit the form

any idea?


cyril

Get a Book for SEBLOD
85 Posts
Jpeg
11 years ago
1
Level 1

Hi Cyril,

My idea

try to add 'disabled and masked' triggers to the field.

or add  'remove class' -> 'requiered'

@+

JP

11 years ago
0
Level 2

But this is what I did:


- add DISABLED and MASKED triggers (they work)

- but keep the 'required' class


but when the field is disabled and masked, it is still required on the submit button !!

However I DO need this field to be REQUIRED when activated


Cyril

11 years ago
0
Level 1

Hello,

It's managed by the conditional script. Try on a native Joomla and SEBLOD to avoid any risk of jQuery conflict.

Let us know.

Best Regards

11 years ago
0
Level 1

Thanks but do you mean the 5 button? I don't see how you can use the 5 button to tell the field is mandatory only if the field is enabled.


 May be you are referring to something else ?


11 years ago
2
Level 1

It's automatic.

If the field has as conditional and it's required and is not enable -> the "required" is disable.

Best Regards.

11 years ago
1
Level 2

Ok

Thanks. But it seems it doesn't work this way on a field X ?


I have:

-  a simple selection list with two values : NO=0 and yes = 1. this field is named trigger

- a TOTO fieldX (on a text field)  with two conditional state: is enabled and is visible IF trigger = 1

but if strigger is set to 0 I can submit the form (the front control is deactivated, that's ok) but I get the error message:

  • Ce champ est obligatoire - TOTO
  • Une erreur est survenue
If I replace the fieldX with a simple TEXT field the error disappears.


11 years ago
0
Level 3

Ok thank you.

It's certainly a specific issue with fieldX field. I invite you to post on the tracker. But please wait 1 or 2 days to post it in the new tracker which will be published soon.

Regards

11 years ago
0
Level 1

Ok Seb , I put it in the new tracker

12 Posts
Fafi
11 years ago
0
Level 1

Olá, desculpe mas falo somente em portugues...
Não testei ainda se funciona com o Groupx, mas consegui fazer a condicional ser obrigatória.
Veja a imagem

Repare que na condicional #1, Foi definido como visível, caso o campo "Já é Empreendedor" for igual a "Sim".
Então ele vai funcionar da seguinte forma: Se o usuário ao se cadastrar informar que é um Empreendedor, então o campo Loja (que é pra ele colocar o link da loja dele) irá aparecer, caso contrário, não aparecerá.

Na condicional #2, foi definido que é desabilitado, caso o usuário diga que não é Empreendedor, fazendo com que o "campo obrigatório" seja anulado, caso ele não seja empreendedor. Caso não coloque essa 2ª condicional, o formulário vai retornar um erro, pois se trata de um campo obrigatório.

Espero ter contribuido de alguma forma

Get a VIP membership