I want to add a default value to text input field in custom options to pass the magento validation. I try to do this in javascript like that: jQuery(".product-options dd input.input-text").attr('value', '--------'); But in some places I need to remove this value: jQuery(".product-options dd input.input-text").attr('value', ''); and when I use this last code, I have: Please specify the product's required option(s).
Thank you
-
you could specify by id instead of class so you can differentiate between which input textboxes need a valueRobin– Robin2016年04月15日 09:47:26 +00:00Commented Apr 15, 2016 at 9:47
-
Hi Anja, yes this was problem :) you save my life, please add your answer, I will vote youRobert– Robert2016年04月15日 11:40:41 +00:00Commented Apr 15, 2016 at 11:40
1 Answer 1
you could specify by id instead of class so you can differentiate between which input textboxes need a value
i.e. instead of jQuery(".product-options dd input.input-text").attr('value', '--------'); you could use something like jQuery(".product-options dd input#youridhere").attr('value', '--------');
Explore related questions
See similar questions with these tags.