Fields
-
Greetings there,
I have 4 fields in my product page.
3 fields where the user inputs a code
1 field where the user inputs a nameFor the ‘code’ fields since I need to get em visible based on item quantity for e.g if quantity is 1 Code field #1 and Name Field would be visible for input, if quantity is 2 Code field #1 & #2 & Name Field would be vissible and finaly if quantity is 3 Code field #1 & #2 & #3 & Name Field would be visible
I tweaked that by using some jquery and all is working fine with the visibility of the fields depending the quantity.
Though I would like to achive something more.
I need that every field which gets vissible based on user’s quantity option to be required. I’ve noticed that if I set all the fields required through plugin’s settings when I try to put something on cart I need to complete every field in order to continue to the order.
With some inspecting I found that every input has a data attribute wccpf-mandatory’ , ‘yes’ or no based on if the field is required or not. So with some jquery again I changed that value to yes when each field gets visible but if I leave one input empty I don’t get any notice that I need to complete the 2nd field for e.g and the order passes
to the cart .Do you know any workaround I could do in order to achive that?.
The topic ‘Fields’ is closed to new replies.