Non-Nested ifs


my noobish understanding "if" statements excuted if boolean true occurs, , if doesn't occur script continues after closing curly bracket.

 

the script below numeric field , fired calculate event, runs repeatedly. i'm wondering why "hello world" part doesn't excuted every time around. instead, waits boolean true from  second "if".

 

 

if (expenseclaim.page2.distancerecord.tablekm.row1.locations.location1.rawvalue.length != 0 && expenseclaim.page2.distancerecord.tablekm.row1.locations.location2.rawvalue.length != 0)

{

blah blah blah

}

 

if  (expenseclaim.page2.distancerecord.tablekm.row1.locations.location2.rawvalue.length != 0 &&  expenseclaim.page2.distancerecord.tablekm.row1.locations.location3.rawvalue.length != 0)

{

blah blah blah

}

 

xfa.host.messagebox("hello world");

 

if  (expenseclaim.page2.distancerecord.tablekm.row1.locations.location3.rawvalue.length != 0 && expenseclaim.page2.distancerecord.tablekm.row1.locations.location4.rawvalue.length != 0)

{

blah blah blah

}

 

if  (expenseclaim.page2.distancerecord.tablekm.row1.locations.location4.rawvalue.length != 0 &&  expenseclaim.page2.distancerecord.tablekm.row1.locations.location5.rawvalue.length != 0)

{

blah blah blah

}

 

and if move "hello world" part below third "if", waits that. what's going on here?

 

thanks.

hi,

 

sometimes code in calculate event doesn't report run time errors, maybe try putting code in click event of button test , see if works.  locationx fields text fields, if numeric wont have length property.

 

bruce



More discussions in LiveCycle Designer


adobe

Comments

Popular posts from this blog

how to devide a circle into equal parts

"Could not fill because there are not enough opaque source pixels" - not solved by any other thread

Why can't I change the billing info for my account?