Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
is there a way to check for a blank field value?

such as

if(fieldname==""){

do something or don't do something

}
Code: Select all
<cms:if fieldname=''>
   ... empty ...
<cms:else />
   ... not empty ...
</cms:if>

or
Code: Select all
<cms:if "<cms:not_empty fieldname />" >
   ... not empty ..
<cms:else />
   ... empty ...
</cms:if>

Hope it helps.
would be nice, if KK will create:

Code: Select all
<cms:if_empty my_var>
...empty...
</cms:if_empty>?


or somthing like it, without not_empty .. else, just one tag and thats all
andrejprus wrote: would be nice, if KK will create:

Code: Select all
<cms:if_empty my_var>
...empty...
</cms:if_empty>?


or somthing like it, without not_empty .. else, just one tag and thats all


Andrej, here you go
-code edited

Tests:

Code: Select all
<cms:set var = '' />
<cms:if_empty var ><br/>1 is empty!</cms:if_empty>
<cms:set var = '0' />
<cms:if_empty var ><br/>2 is empty!</cms:if_empty>
<cms:set var = '<p></p>' />
<cms:if_empty var ><br/>3 is empty!</cms:if_empty>


1 is empty!
3 is empty!
SUPER COOL !!!!
5 posts Page 1 of 1
cron