on 03-20-2009 5:06 PM
Hi Friends,
I have three subforms containing three tables.
For example
table1
table2
table3
If one of the table is empty, then i want to hide dynamically that subform.
So i want to write some script on the subfomrs to check if the content is present in the table or not.
If there si no data then i want to hide that entire subform.
Can you please help me in writing the script to hide the subform based on the data in the table.
Sample code is really helpfil.
Thanks in advance.
Regards,
Sasidhar
In the initialize event of the subform, you could put a script like the one below. Replace table with the name of your table and field with the name of a field in your table.
if ($.table[0].field.value.#text == "") then
$.presence = "hidden"
else
$.presence = "visible"
endif
This should check that a field in the first row of the table has a value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
My Hierarchy.
Subform
subform1
subform2.
The subform2 contains the table as well as a field.
subform2
v_tect
i_table1.
If the table i_table1 does not contian any entries i want to hide the entire subform2 including the table as well as the field v_tect.
So i kept the code that you provided in the initialize event of the subform2.
Can you please tel me if iam doing something wrong.
Thanks in advance
regards,
Sasidhar
Hi,
subform2
v_tect
i_table1.
I kept the following code in the subform2.(TDLINE is the field name in the table i_table1)
Form clac is the language i selected.
if ($.i_table1[0].TDLINE.value.#text == "") then
$.presence = "hidden"
else
$.presence = "visible"
endif
Regards,
Sasidhar
Edited by: sasidhar yalamanchili on Mar 20, 2009 7:10 PM
Use the autocomplete function to of the script editor to build the correct expression.
Type in $. (be sure to include the period) and it should give you a list of options. Just keep moving down your hierarchy to get to the element you want.
So type $.
In the list, you should see DATA as one of the options. Choose it.
Now you have $.DATA
Type another .
Chose TDNAME
Etc...
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.