The value does not match

Hi. I working in dynamic page where I try multiply value from input4 (quantity) and Imput2 (price) where outcome is send to imput6. all working fine but when submit values are send to database are correct a part of imput6.

my code:

export function input2_change ( event ) {
let qty1 = Number ( $w ( ‘#input4’ ). value );
let price = Number ( $w ( ‘#input2’ ). value );

 $w ( "#input6" ). value  +=  qty1 * price 
 console . log (( qty1 * price )) 

}

Thanks,

G

Hi NajcargS,

Just change the type setings of your text field to number should do the trick

Kind regards,
Kristof

Hi, I did but dont work :frowning:

You are using a form or just a dataset?

Dataset. If this help when I retype the numbers then works fine.

Can you post an image of datase
and if you have any other code can you post that here aswel?
Maybe the whole page code?

Also an full image of the website layout in the editor

and maybe show me how you linked the input field to the dataset

QtyXpaid and QtyXprice that’s columns where $w ( “#input6” ) is connected to.
On that page I don’t have more code then this what I post.

i Don’t see any ! anymore? or did you remove all?

I tried it myself and i don’t see anyproblem,
Wich field was giving the “!”?

I retype bad column sorry. on pic.1 you can see value of 6,00 and 8,00 and the connected to QtyXpaid and QtyXprice

I think i found it.

You posted an image with the text
Hi, I did but dont work :frowning:

There you showed me the type of the field
When i look closer i see it says whole numbers,
While it dispalys 8,00 and 6,00

try to change whole numbers to decimal numbers

Kind regards,
Kristof.

I THink this means soemwher eyou multiply it by a decimal

I swap to whole numbers and decimal on all inputs and this same.

Can you build db on your pc and try with my code? Maybe my code is bad…

I tried it and i don’t have any problems doing so.

What you can do is.
Make a copy of your website
and make me a contributor of your copied website so i can take a look at it.
Use this [email:](email:
kristof.print3d@gmail.com

This)
[kristof.print3d@gmail.com](email:
kristof.print3d@gmail.com

This)

[This](email:
kristof.print3d@gmail.com

This) w ay i can take a look and help where needed and reply with the solution.

Be aware, i am in no way connected to wix.
So its on your own risk (thats why i suggest making a copy and make me contributor of that website only)

Let me know if you added.

Kind regards,
Kristof

Hi again. Thank you for helping me. I just make copy and I add you . The page is named Input. let me know If you find something wrong.

Hi NajcargS,

It took a while but i found a solution.

Seemslike an element isn’t updated to the dataset if the element is filled by code.
So i removed the link with the submit button,
added the 2 elements to the dataset and saved it.
This seems to be working fine.

Kind regards,
Kristof