This site uses cookies and similar technologies.

If you don't change browser settings, you agree to it.

I understand
1 year ago
6
Topic

Hi

in a backend form we need to test if one field "myField" is empty or if it is not empty

SO we have:

* a checkbox field "is_empty" whose values are 1 or 0. The search criteria is NONE since we don't want to actually search on this field

* the myField with a search criteria set to EMPTY and a conditional state that says that this field is ACTIVE / VISIBLE only if "is_empty" is set to 1

However in both cases (is_empty =0 or is_empty =1) the search performs the SQL query with myField ="" !!

The conditional state works because we see myField appearing or disappearing in the search form depending on the value of  is_empty

it is ACTIVE state of the conditional state that doesn't seem to work

Any idea please ?

thanks

cyril 

Get a Book for SEBLOD
4229 Posts
Kadministrator
1 year ago
2
Level 1

You should set field to disabled, not hidden, when you don't wan't it to affect query.

1 year ago
1
Level 2

Hi Klas

Of course I know that VISIBLE or not the field is taken in the SQL query :)

This is why I wrote I use the ACTIVE state in the conditional state . The VISIBLE state was only here to be sure the conditional state works when I select  yes or no in the other field (is_empty !

But just as I wrote I can't make the myField active / inactive depending on the is_empty field

when you display the sql query called (debug = on) myField is always taken

thanks

cyril

4229 Posts
Kadministrator
1 year ago
0
Level 3

So the problem is :

a) conditional is not working - myField is not disabled.You can verify this by looking into html if field has disabled attribute.

OR

b) disabled state is not used - field always produces a query

?

1 year ago
1
Level 1

Hi again

As I wrote this is the 2nd case : disabled state is not used - field always produces a query


thanks

cyril

1 year ago
0
Level 2

HI 

I may also add that the disabled state works on the screen (I can no longer type in the field) but the field is still used in the sql query

thanks

cyril

1 year ago
0
Level 1

Hi

new issue posted on https://github.com/Octopoos/SEBLOD/issues/510


cyril

Get a Book for SEBLOD