Skip to content
Advertisement

required attribute not working in form in codeigniter php

i have a shopping website in codeigniter, where have a product details page, in which user should select the color and size which is mandotory before adding to cart, so i did the following code:

JavaScript

however, the required attriubute is not working, user is able to click the add to cart button, can anyone please tell me how to fix it, thanks n advance

Advertisement

Answer

Change your code to this.

JavaScript

Should work

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement