on 03-12-2010 1:30 PM
Hi,
I am trying to hide a text field when it is empty in Adobe form .
The code for this
if( hasValue($record.LOCAT) )
LOCAT.presence eq 'visible'
else LOCAT.presence eq 'hidden'
endif.
I have written this code in the initialise event for the text field.
As far as I know this is possible for interactive forms. Is there a possible way to implement it in for static adobe form.
I am very new to both Adobe form and java scrpit.
Please help me .
Rashi
yes, this is possible in a static form
try using an "=" instead of "eq" - that may help... otherwise your problem may be due to your hasValue($record.LOCAT) statement
if ( yes.rawValue eq "1" ) then
data.Page2.grp2.fin.text.ifyes.presence = "visible"
endif
here's a very helpful resource on scripting
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I tried both ur suggestions but no luck.
I also went through the document and implemented the following changes to my form
Created a script object with a function in it trying to make the text field hidden in all cases
function emptyCheck(oField){
if ((oField.rawValue == null) || (oField.rawValue == "")) {
oFieild.presence = "hidden";
}
else{
oFieild.presence = "hidden";
}
}
and then applied to my text field in the initialize event
script_obj.emptyCheck(this);
While testing (print preview) it is not showing any error but when I am running my form it still shows the text field.
My requirement is this that if the field is empty it should be hidden and I would like to be able to move the lines below it upward on the form to fill in the space left by the data field so that no empty space is displayed.
Am I doiing anything wrong ?
Please suggest.
Rashi
i think you're making this way too complicated using a script object.
it's a very simple IF statement
here's another example
if ($.DEFER ne "X") then
DeferSub.presence = "hidden"
endif
I'm passing in a value to a field called DEFER. If that Value does not equal X, I'm hiding an enitre subform called DeferSub
This is using Formcalc - in the script editor, there's a dropdown where you can choose between formcalc or javascript.
also, here's a great resource on scripting
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.