cancel
Showing results for 
Search instead for 
Did you mean: 

Reg error in Javascript

former_member182465
Active Participant
0 Kudos

Event I used - *Formready

default path given by ALD -


data.BodyPage.SF1.ITEMS.DATA :: ready:form - (Javascript, Client) -


And i had written following code


var data1;
 data1 = "Total"
if ( xfa.form.data.BodyPage.SF1.ITEMS.DATA[*].XBLNR.rawValue == data1 )
{
  xfa.form.data.BodyPage.SF1.ITEMS.DATA.XBLNR.border.fill = "True" ;
}
 else{
 xfa.form.data.BodyPage.SF1.ITEMS.DATA.XBLNR.border.fill = "False";
 }

What i am doing :

variable data1 is having a value Total. Then i am comparing the value of field (xblnr) which is in ITEMS table . if value found,then i m filling the border.

But i am not getting any error in javascript and no changes on output . Can anybody suggest me in this?

Answer will really be appriciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try writting the code in the initialise event of the field XBLNR of the table.

You can write:

if ( this.rawValue == "Total" ){

this.parent.XBLNR.border.edge.color.value = "0,0,255";

}

Thanks,

Omkar Mirvankar.

Answers (4)

Answers (4)

former_member182465
Active Participant
0 Kudos

Refer Omkar solution. That solved my problem.

former_member182465
Active Participant
0 Kudos

Thanks Omkar,Otto,Liz for Suggestions.

Omkar, solution given by you worked fine.

Border is coming for the entire field i.e Left, Right,Top and Bottom but my requirement is to get the border only at Top and Bottom.

So if you or other experts can suggest me the solution. Please advice.

OttoGold
Active Contributor
0 Kudos

I am not sure if that can be done through scripting - to control each line separately. If you would not find a "proper/ right" solution, you can always create two fields, one without the border, second with the border you like and instead of manipulating the border, manipulate the fields visibility. Much easier, at least for me, regards Otto

Former Member
0 Kudos

Hi,

I might be incorrect, but please check the foll-

In javascript, all the variables and values you use are case sensitive. Pls. check this. Make sure all statements end with " ; "

You may be able to activate the form successfully despite incorrect coding in the script.

How I check for errors is by display both the values I am comparing, using a popup as follows -

xfa.host.messageBox("Total: " + Total);

Thanks, Liz

OttoGold
Active Contributor
0 Kudos

Is your form dynamic? (a guess)

Did you check the value is already present when doing your comparison?

Regards Otto