Hi,
may someone help me?
I have a DDList that controls(visible or hidden) two subforms.
This I try to achive is when a subform is hidden the mandatory field to become non mandatory and via versa..
Below is my sample:
Thank you
Views
Replies
Total Likes
Hi,
I think you are passing in the wrong value to the reSet function, try this;
form1.P1.DropDownList1::change - (JavaScript, client)
switch (xfa.event.newText)
{
case "Employee":
Sub_b.presence = "hidden";
scrMandatoryFields.reSet(Sub_b,"disabled");
Sub_a.presence = "visible";
scrMandatoryFields.reSet(Sub_a,"error");
break;
case "Manager":
Sub_a.presence = "hidden";
scrMandatoryFields.reSet(Sub_a,"disabled");
Sub_b.presence = "visible";
scrMandatoryFields.reSet(Sub_b,"error");
break;
}
and then change the reSet function inner loop to
function reSet(parSubForm,parMandatory)
{
// parSubForm - contains the name of the subform
// parMandatory - contains error when the subform is set to visible
// - contains disabled when the subform is set to invisible
for (var i=0; i < myMandatoryFields.length; i++)
{
if (myMandatoryFields[i][0] == parSubForm.name) {
for (var j=1; j < myMandatoryFields[i].length; j++)
{
var field = parSubForm.resolveNode(myMandatoryFields[i][j])
if (field !== null) // sample has 1 field but array length 2 (or 3)
{
field.mandatory = parMandatory;
}
}
}
}
}
Regards
Bruce
Views
Replies
Total Likes
THANK YOU for your time to help me with this one!
Your solutions WORKS!!!
Thank you
Views
Replies
Total Likes