Need to multiply 2 fields on portal

Sri56
Tera Contributor

Hi Team,

 

we have two fields :

number of request (single line text) and capacity (single line text).

we need to multiply these and set in capacity only once.

trying the below code

but this is running on a loop.

 

 

please help me with the code.
var res = parseInt(g_form.getValue('number_of_requests')) * parseInt(newValue);
        alert(res);
        g_form.setValue('capacity', res);

So when number of request given 40 and capacity given 3 when user take off the cursor it should multiply and set as 120.

the above code should not trigger again (whereas not in a loop)

Please help!

Sri56_0-1699855719929.png

 

Thanks!

Sri

10 REPLIES 10

Jaspal Singh
Mega Patron
Mega Patron

Hi Sri,

I assume the script is onChange(). Would it be possible to share entire script and configuration once.

Hi Jaspal,

 

Yes, it is on change,

please find the attached screenshot:

Sri56_0-1699856726090.png

please help!

 

Thanks,

Sri

 

You can comment out line 6,11 and 12.

Hi Jaspal,

 

Even after commenting, its keep on multiplying.

please help!

Thanks,

Sri