Skip to content

Commit

Permalink
Account for disabled inputs (#189)
Browse files Browse the repository at this point in the history
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
  • Loading branch information
GioSensation authored Mar 12, 2024
1 parent c1beb76 commit 94f9ca1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autofill/autoprompt/3-multistep-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,22 @@ <h2>Log in</h2>
</fieldset>
<fieldset class="password-container" hidden>
<label for="password">Password</label>
<input id="password" type="password" required>
<input id="password" type="password" required disabled>
<button type="submit">Log in</button>
</fieldset>
</form>
</div>

<script type="module">
const continueButton = document.querySelector('button[type=button]');
const submitButton = document.querySelector('button[type=submit]');
const passwordContainer = document.querySelector('.password-container');
const passwordField = document.querySelector('#password');

continueButton.addEventListener('click', () => {
if (form.email.validity.valid) {
passwordContainer.removeAttribute('hidden');
continueButton.setAttribute('hidden', '');
passwordField.removeAttribute('disabled');
}
});

Expand Down

0 comments on commit 94f9ca1

Please sign in to comment.