These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

addInstance validation

NancyM
Registered: Sep 25 2006
Posts: 40

I have created a fomr in LiveCycle 7.0. I am using AddInstance to created additional lines to be filled in. I have validations on the first subform, but they are not carried to the additional subforms. How can I accomplish the validation of the additional lines?

My Product Information:
Acrobat Pro 7.0.0, Windows
pddesigner
Registered: Jul 9 2006
Posts: 858
I do not have a good answer for this post but I do have info on a new book coming out in August 2007. You can pre-order at Amazon.com

Creating Dynamic Forms with Adobe LiveCycle Designer (Paperback)
by J. P. Terry (Author)
List Price: $50.00



Language: English
ISBN-10: 0321509870
ISBN-13: 978-0321509871

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.

NancyM
Registered: Sep 25 2006
Posts: 40
I did receive some help on this subject in the Adobe LiveCycle Designer Forum. It took awhile but it does work. I am posting the following script hoping that will help others.

----- form1.Header.CompanyInfo.Request.AddALine::click - (JavaScript, both) ------------------------

//check the number of DETAIL instances
var numberOfDetail = xfa.resolveNodes("Detail[*]").length;

//start a FOR loop on all the DETAILS
for(var i = 1 ; i 4))
{
app.alert("Please enter a valid quarter number.");
fQtr.rawValue = null;
cVar = 1;
}
else
{
cVar = 0;
}
////Validate State
var dVar = 0
if ((fTaxType.rawValue == 3) && (fJ_State.rawValue == null))
{
app.alert("Please select the state needed.");
dVar = 1;
}
else
{
dVar = 0;
}
////Validate Local
var eVar = 0
if ((fTaxType.rawValue == 4) && (fJ_Local.rawValue == null))
{
app.alert("Please enter the local jurisdiction needed.");
eVar = 1;
}
else
{
eVar = 0;
}
////////////

}////////////Argument to add a line
if ((Request._Detail.count == Request._Detail.max - 1) && ((aVar == 0) && (bVar == 0) && (cVar == 0) && (dVar == 0) && (eVar == 0)))
{
app.alert("The maximum number of items allowed per form is 10.\n\nThis is the last entry for this request",3,0);
Request._Detail.addInstance (true);
}
else if ((aVar == 0) && (bVar == 0) && (cVar == 0) && (dVar == 0) && (eVar == 0))
{
Request._Detail.addInstance (true);
}