on 04-17-2012 3:07 PM
Hi Experts,
I have a check box.If i click it,i want a subform to be hidden.
i wrote the script on click event:
if (this.rawValue == 0)
{
subform.presence = "visible";
}
else
{
subform.presence = "hidden";
}
But this code is not working.I tried Formcalc as well.
Please help me to solve this issue.
Regards,
Arun.
HI
In the FORM-CALC / initialization/Client
==> write this code at the SUBFORM and not at the CB
if($record.<CHECKBOX NAME> == "X" )
then
$.presence = "visible"
else
$.presence = "hidden"
endif
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
Do you need a toggling functionality?
if so...
Since the click event triggers immediately as and when the checkbox is clicked and the value of the checkbox is updated after the event is completed you cannot go setting the subform visibility based on checkbox value.
you can put the code in 2 events which is mandatory.
1) on document or subform ready : reason being to to set the current visibility status to subform when a saved form is opened.
2) on the checkbox click event: to set the subform visibility at runtime or form edit.
1) subform ready / document ready event:
note: script is in java not form calc, you write respective formcalc script if you know.
<subform absolute path>.presense = (<checkbox absolute path>.rawvalue == "1") ? "visible" : "hidden";
2) on checkbox click event:
<subform absolute path>.presense = (<subform absolute path>.presense == "visible") ? "hidden" : "visible";
Hope this gives you clear picture of reason having script in 2 areas and solves your issue, let me know if you need more info.
Cheers,
Sai
Try writing in change event
Rakesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.