on 01-08-2010 9:11 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chintan:
Thanks. I tried your logic in Javascript as well as in formcalc ( "||" to be replaced by "or" ) and it works in both.
On further efforts, I found that the logic just needs to check the value as "null" and indeed we have to check parameter .rawValue to make it work.
Thanks again. It works like a charm.
Hi Otto:
Thanks for your answers too. Since the above logic worked, I did not dig further into the OSS note you referred. But I really appreciate your help.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Otto:
I must confess I don't have a very good depth of knowledge using Javascript or its functions.
I assume we have to use the script at the subform level (under which the field is kept) and that we use the script at event form:ready, correct?
I have tried them at form:ready as well as at event form:initialize but to no avail.
Thanks.
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
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.