根据所选选项动态更改库存数量

I am currently working on a project to create an e-commerce website. Here's the problem:

I'm in the product page and there is an availability input which indicates if a product is available or not
there is also several select (depending on the product category) to filtre the product for exemple 3 select one for color the other for size the other for design

My question is: How can i change the availabily input depending on what the user selects in those 3 select options KNOWING THAT ! the user can select only one if he wants to and leave the other 2 select blank and the availability input would still be showing the data

PS: My database is already working and i can do what ever query is possible. My only problem was how to code this using ajax and php, if the user selected all the options to show the availability, i can do that but i want him to choose whatever combination he wants in the filtre. Thank you in advance.