Difference between revisions of "NationStates:Login"
From NSWiki
m (fix login) |
(add support for pressing enter on input fields) |
||
Line 1: | Line 1: | ||
− | <shtml version="2" keyname="afforess" hash=" | + | <shtml version="2" keyname="afforess" hash="43d55a98f8c64cc99d24435502fa2b6c84b79863f7d94d60a5be6286c287f9b7"><input id='nation_name' placeholder='Nation Name' type='text' style='width:350px;height:24px;'></input><button class='btn' style='margin-left:5px;margin-top: -3px;' id='nation_enter'>Locate Nation</button> |
<p id='login_error' style='color:red; font-weight:bold; display:none;'>An Error Occured</p> | <p id='login_error' style='color:red; font-weight:bold; display:none;'>An Error Occured</p> | ||
Line 9: | Line 9: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
+ | $("#nation_name").on("keydown", function(event) { | ||
+ | if (event.keyCode != 13) { | ||
+ | return; | ||
+ | } | ||
+ | $("#nation_enter").click(); | ||
+ | }); | ||
+ | $("#nation_verify_login").on("keydown", function(event) { | ||
+ | if (event.keyCode != 13) { | ||
+ | return; | ||
+ | } | ||
+ | $("#nation_verify").click(); | ||
+ | }); | ||
var ampersand = "&"[0]; | var ampersand = "&"[0]; | ||
console.log(ampersand); | console.log(ampersand); |
Revision as of 21:20, 22 January 2014