Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Populating Fields with Numeric Values

Avatar

19-05-2008

Hi,



I have a form which has a First Rental Box which our customers type in a numeric value. Next to this box is a VAT box which needs to be populate automatically. VAT is calculated by First Rental Value * 17.5 / 100. How I automatically populate the vat box with the correct value? Also, once thats been done, I have a total box which needs to be populate with First Rental + VAT?



Hope you guys can help.



David

Replies

Avatar

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct Reply

0 solutions
View profile

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct Reply

0 solutions
View profile
_SekharN_
Level 5

19-05-2008

assuming all the fields for this calculation are in the same subform you may use code similar to the following...



try the JavaScript code on the 'exit' event of the FirstRentalValue field



if (!this.isNull) {

this.parent.vat.rawValue = this.rawValue * (17.5/100);

this.parent.total.rawValue = this.raValue + this.parent.vat.rawValue;

}

Avatar

02-06-2008

SekharN, please can you explain a little more, Im not too good with this java script.



The Rental Box name is Text46, the Vat box name is Text46a and the total Box Name is Textab.



Now I know somehow once Ive filled in the first value, the javascript will then work out the vat and total and automatically populate the correct values, but how do I achieve this?



Thanks

Avatar

04-06-2008

Ok, can anyone help with this one. Ive tried to populate the fields with the relevant values but I just cant get it done. Ive now change the exit action in the script editor to do the following



FirstRentalVat = FirstRental * (17.5/100)

FirstRentalTotal = FirstRental + FirstRentalVat



Now how to I populate the VAT Box with FirstRentalVat value and like wise for the Total box to have the value of FirstRentalTotal?