Skip to Content
avatar image
Former Member

How to hide the entire field (even the caption) when the variable value is

I have defined a text field with text caption in ADOBE form.

How do I hide the entire field (even the caption) when the variable value is blank?

I have the tried the formcalc script (form:ready event) at subform level like following:

if ( $.VAR1 == " " ) then

$.VAR1.presence = "hidden"

endif

But it doesn't hide the text caption.

Thanks.

Jitendra Mehta

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 11, 2010 at 06:49 AM

    Is this a print form or Interactive form? Also try the following code in JavaScript

    if (VAR1.rawValue == "" ||  VAR1.rawValue == null) 
    {
       VAR1.presence = "hidden";
    }
    else
    {
      VAR1.presence = "visible";
    }

    Chintan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello,

      i am facing the same problem and have used below code as formcalc in server and client but it is not working for me.

      Event is form ready;

      if ($record.GV_AMT_PAYABLE_COMP.rawValue == "" or $record.GV_AMT_PAYABLE_COMP.rawValue == null)

      {

      GV_AMT_PAYABLE_COMP.presence = "hidden";

      }

      else

      {

      GV_AMT_PAYABLE_COMP.presence = "visible";

      }

      Thanks for your helps in advance.

      Regards

      Beserithan

  • Jan 11, 2010 at 09:54 AM

    Hello,

    I can recommend you to use simple debug messages to see what the value is on runtime. Maybe you would be surprised and confused about the result:)) Use "app.aler(yourvariable.rawvalue)" in JavaScript coding to get the message box, note: it is double p like application, but I am not allowed to write it in the post, same with the a-l-e-r-t.

    Sometimes nothing means a SPACE character, sometimes "" (like really nothing = string size 0), sometimes NULL. Play with that for a moment (do that in a LCD only on your desktop, not in SAP, to spare some time).

    Regards, Otto

    Add comment
    10|10000 characters needed characters exceeded

    • I don´t like this scripting too, but sometimes it is a must to use it.

      Yes, put the script on subform, you can try more than one event (not at once) to find the proper one. I would use initialize event. Or maybe try the layout:ready event.

      I guess you´ll need your form to be dynamic. Please check that, it is a prerequisition to make the layout changes work.

      If such a note has not been applied yet, please search for the note which fixes the bug in dynamic but not fillable forms. I think it is no: 1319176.

      Regards, Otto

  • Mar 26, 2010 at 12:40 PM

    1) you mix up formcalc and javascript, I think

    2) you´re not welcomed here because you don´t have a single point and keep asking. You have never helped a living soul thus nobody is going to help yoiu around here. Please fix this and we can come back to your problems. Otto

    Add comment
    10|10000 characters needed characters exceeded