diff --git a/app/styles/base.css b/app/styles/base.css index 0518acc46ffad047e6a0836c8a19574e3101c3f3..c8b63b3b4ddda2130206eb6b50901e5752dd09bb 100644 --- a/app/styles/base.css +++ b/app/styles/base.css @@ -91,7 +91,7 @@ input[type=input], input[type=password], input:not([type]), textarea { background: linear-gradient(to top, rgb(255, 255, 255) 80%, rgb(240, 240, 240)); } -input[type=button], select { +input[type=button], input[type=submit], select { /* Disable default rendering */ -webkit-appearance: none; -moz-appearance: none; @@ -109,7 +109,7 @@ input[type=button], select { vertical-align: middle; } -input[type=button] { +input[type=button], input[type=submit] { padding-left: 20px; padding-right: 20px; } @@ -121,29 +121,35 @@ option { input[type=input]:focus, input[type=password]:focus, input:not([type]):focus, input[type=button]:focus, +input[type=submit]:focus, textarea:focus, select:focus { box-shadow: 0px 0px 3px rgba(74, 144, 217, 0.5); border-color: rgb(74, 144, 217); outline: none; } -input[type=button]::-moz-focus-inner { +input[type=button]::-moz-focus-inner, +input[type=submit]::-moz-focus-inner { border: none; } input[type=input]:disabled, input[type=password]:disabled, input:not([type]):disabled, input[type=button]:disabled, +input[type=submit]:disabled, textarea:disabled, select:disabled { color: rgb(128, 128, 128); background: rgb(240, 240, 240); } -input[type=button]:active, select:active { +input[type=button]:active, input[type=submit]:active, +select:active { border-bottom-width: 1px; margin-top: 3px; } -:root:not(.noVNC_touch) input[type=button]:hover:not(:disabled), :root:not(.noVNC_touch) select:hover:not(:disabled) { +:root:not(.noVNC_touch) input[type=button]:hover:not(:disabled), +:root:not(.noVNC_touch) input[type=submit]:hover:not(:disabled), +:root:not(.noVNC_touch) select:hover:not(:disabled) { background: linear-gradient(to top, rgb(255, 255, 255), rgb(250, 250, 250)); } diff --git a/app/ui.js b/app/ui.js index 47263555ff02a2b80f1d6dd5aedf0889a26c4a32..83233a7c1f60004ff28b97298794e5c4f0a4c2a4 100644 --- a/app/ui.js +++ b/app/ui.js @@ -1152,13 +1152,14 @@ var UI; UI.showStatus(msg, "warning"); }, - setPassword: function() { + setPassword: function(e) { var password = document.getElementById('noVNC_password_input').value; UI.rfb.sendPassword(password); UI.reconnect_password = password; document.getElementById('noVNC_password_dlg') .classList.remove('noVNC_open'); - return false; + // Prevent actually submitting the form + e.preventDefault(); }, /* ------^------- diff --git a/vnc.html b/vnc.html index 0048046d21b07bbbf398a6660f7a852d1cddf4a6..c6f0d25bd8800450f0847a3294ae4de63c98d15d 100644 --- a/vnc.html +++ b/vnc.html @@ -277,17 +277,17 @@ <!-- Password Dialog --> <div class="noVNC_center noVNC_connect_layer"> - <div id="noVNC_password_dlg" class="noVNC_panel"> + <div id="noVNC_password_dlg" class="noVNC_panel"><form> <ul> <li> <label>Password:</label> <input id="noVNC_password_input" type="password" /> </li> <li> - <input id="noVNC_password_button" type="button" value="Send Password" class="noVNC_submit" /> + <input id="noVNC_password_button" type="submit" value="Send Password" class="noVNC_submit" /> </li> </ul> - </div> + </form></div> </div> <!-- Transition Screens -->