cancel
Showing results for 
Search instead for 
Did you mean: 

Remove spaces for Hidden Field

Former Member
0 Kudos

Hi All,

I have a Subform in which i have 3 Fields and a TextField like this :

TextField.

Field1.

Field2.

Field3.

If any of the given field is empty, i have to remove that field from the form.

I have written this script for the fields :

if ( not hasValue( $ ) )then

$.presence = "hidden"

endif

Now the fields are getting hidden but it is still showing empty space at that particular row.

How to remove the spaces for empty field ?

I have made the Content of Subform as Flowed but still problem remains .

Any inputs ?

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi,

As you have placed this field in a subform which is flowed,

try to make the subform as hidden in your script than making the field as hidden.

i.e. subform.presence = "hidden" instead of $.presence = "hidden"

Thanks,

Madhu.

Former Member
0 Kudos

Hi Madhu,

I think my Q wasnt clear to you.

I want to remove the spaces. If i write the scipt which you have given it will make the Subform hidden when Field is having no data.

All three Fields are in one subform only.

If Field2 is empty , it is coming like this :

TextField.

Field1

Field3.

I want like this :

TextField

Field1.

Field3. in case Field 2 is empty.

Any idea ?

0 Kudos

Hi saurav,

you have 3 fields in one subform as of now.

now make every field in to individual subform and make it as flowed.

you can do this by

1. select the textfield and then right click then select wrap in subform.

2.rename the subform to some name and make it as flowed.

repeat the same steps for other 2 fields also.

now you have 3subforms with 3 fields in each subform.

place these 3 subforms in one more subform which is also set as flowed.

Now you write the script to make the subform as hidden which has textfield2.

New Node Hierarchy:

mainsubform--flowed

subform1--flowed

textfield1

subform2--flowed

textfield2

subform3--flowed

textfield3

if textfield2 is empty.

script now: mainsubform.subform2.presence = "hidden"

i tried this and its working for me.

Thanks,

Madhu.

nikhilkup
Active Participant
0 Kudos

Hi Saurav,

you Just need to make the subform flowed type and it will work. No need to put each field inside a sub form.

Edited by: Nikhil Poojari on Aug 14, 2009 11:32 AM

Former Member
0 Kudos

HI nikhil,

I have already made the subform as Flowed and made fields "hidden" but still problem remains.

nikhilkup
Active Participant
0 Kudos

Yes its not working for me too.

The only other option is to put all the fields in individual subforms and the main sub form as Flowed.

write this code code in javascript Change event & initialisation.

if (this.rawValue == "NO")

{

SUBFORMNAME.presence = "visible";

}

else

{

SUBFORMNAME.presence = "hidden";

}

Subformname = is the name of the subform in which the field which needs to be hidden is wrapped in.

Edited by: Nikhil Poojari on Aug 17, 2009 7:12 AM