T
T
TchernyavskyDaniil2018-02-11 23:35:32
JavaScript
TchernyavskyDaniil, 2018-02-11 23:35:32

How to return the color with proper validation?

Good evening. There is validation. When sending data, in case of incorrect - red color.
I don't understand how to remove/return the color when the field is already entered correctly.
https://htmlacademy-javascript.github.io/502911-ke...
https://codepen.io/anon/pen/rJmGgr
Focus on addListeners function and invalid listener
Please tell me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
string15, 2018-02-12
@string15

if (priceValidate() && titleValidate()) {
        evt.target.style.borderColor = '';    
      } else {
        evt.target.style.borderColor = 'red';
      }

Of these functions, you need to return true in the last condition

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question