Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0sec committed Jul 12, 2023
1 parent 8dbd98b commit 7f94cb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/FormValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class FormValidator{
}

toggleButtonState(){
console.log(this._getFormValidity(this._inputElements))
if(!this._getFormValidity(this._inputElements)) {
this._submitButton.classList.add(this._inactiveButtonSelector)
this._submitButton.disabled = true;
Expand All @@ -53,6 +54,7 @@ class FormValidator{
_setEventListeners(){
this._inputElements = [...this._form.querySelectorAll(this._inputSelector)];
this._submitButton = this._form.querySelector(this._submitButtonSelector);
this.toggleButtonState();
this._inputElements.forEach((inputElement) => {
inputElement.addEventListener("input" , (e) => {
this._checkInputValidity(inputElement);
Expand Down
3 changes: 2 additions & 1 deletion page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ const cardSelector = '#card-template'
closeModal(profileAddModal);
addForm.reset();
console.log(this.querySelector('.modal__button'))
this.querySelector('.modal__button').classList.toggle('modal__button_disabled')
//this.querySelector('.modal__button').classList.toggle('modal__button_disabled')
addCardValidator.toggleButtonState();
};

/*********************************************************************************************/
Expand Down

0 comments on commit 7f94cb9

Please sign in to comment.