1

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

asked Apr 15, 2016 at 6:20
2
  • you could specify by id instead of class so you can differentiate between which input textboxes need a value Commented Apr 15, 2016 at 9:47
  • Hi Anja, yes this was problem :) you save my life, please add your answer, I will vote you Commented Apr 15, 2016 at 11:40

1 Answer 1

2

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', '--------');

answered Apr 15, 2016 at 12:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.