cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding a drop-down field if field is empty

Former Member
0 Kudos

Hi ScriptExperts,

I am not able to hide a drop-down field, if the field has No value assigned to it.

This drop-down field is wrapped in a subform.

I have tried following scripts, but so far nuthing has clicked

1. if ( $.record.fieldname.data[*].field == "" ) then

$.presence = "hidden"

endif.

2. if ( $.record.fieldname.data[*].field == "null" ) then

$.presence = "hidden"

endif.

3. if ($.rawValue == "") then

$.presence = "hidden"

endif

I am applying these scripts both on the drop-down , as well as the subform enclosing it (hoping it will work somewhere! )

Can anyone please guide me where am i going wrong ? also..i have used these scripts in the Form ready , Layoue Ready events.

Many Thanks,

Aditi

Accepted Solutions (1)

Accepted Solutions (1)

ChrisSolomon
Active Contributor
0 Kudos

You are sooooo close. You actually need to check "empty" overall...that means make sure that the field's value is BOTH....not equal to "" (blank) and not equal to null. There is a very good blog written by Stefan Cameron on how to detect this....

http://forms.stefcameron.com/2006/05/19/is-that-field-empty/

Former Member
0 Kudos

That was THE solution Chris ! worked like a charm

Thanks to you and Stef.

Full points awarded

Answers (0)