on 08-12-2009 6:35 AM
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 ?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ?
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.
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
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.