Hej
Mam sobie formularz do logowania się na strone. Dwa inputy: login i hasło. Chcę, zeby działał na takiej zasadzie:
1. Wypełniasz login klikasz Dalej
2. Pojawia się input z hasłem. Login znika. Pojawia się przycisk "Zaloguj" i "Wróć".
Tyle o ile udało mi się to zakodować, żeby działało poprawnie w wersji mobilnej i "klikanej" na PC to mam problem, bo jak na PC jesteś w polu "login" i nacisniesz enter powoduje to wysłanie nieuzupełnionego formularza zamiast pojawienia się pola "Hasło". Kod wygląda tak:
<form action="" data-ajax="true" method="post"> <input type="text" name="Login" maxlength="50" autocomplete="off" id="Login"> <input type="password" value="" maxlength="26" class="size-200 x-field-1 input-password" id="Password"></input> <input type="hidden" id="step5" name="step5" value="OK"></input> <button type="button" id="backbutton" style="display:none;" role="button" aria-disabled="false" onClick="document.getElementById('loginbutton').style.display = 'none';document.getElementById('PasswordLI').style.display = 'none';document.getElementById('LoginLI').style.display = 'block';document.getElementById('nextstepbutton').style.display = 'inline';document.getElementById('backbutton').style.display = 'none';"><span class="ui-button-text">Wstecz
</span></button> <button type="button" id="nextstepbutton" aria-disabled="false" onClick="document.getElementById('loginbutton').style.display = 'inline';document.getElementById('PasswordLI').style.display = 'block';document.getElementById('LoginLI').style.display = 'none';document.getElementById('nextstepbutton').style.display = 'none';document.getElementById('backbutton').style.display = 'inline';"><span class="ui-button-text">Dalej
</span></button> <input id="loginbutton" type="submit" style="display:none;" role="button" aria-disabled="false" onClick="document.getElementById('nextstepbutton').style.display = 'none';" value="Zaloguj"></input>
Jak mogę go naprawić?