php - Jquery refresh select lists each second -


i working on e-commerce project , set 2 dropdown lists linked in ajax. first list contains products , second 1 contains quantity of each product.

there problem when user selects product , quantity, and, in same time user selects product , quantity => quantities not correct. try explain mean.

imagine first product named "a" 2 quantities. first user choses product , selects 1 quantity. there 1 quantity left product. @ same moment, if user selects same product, quantities show "2" ! difficult explain wonder if timeout function should fix this.

you use settimeout update quantity drop down items every based on product user has selected think bit overkill.

you have set , store on server quantity values every time user changed selection.

it do-able re-validate quantity user has selected still available once submit form.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -