diff --git a/js/JoinSecuredNetworkPage.js b/js/JoinSecuredNetworkPage.js index 6bcf5aa..54a3a27 100644 --- a/js/JoinSecuredNetworkPage.js +++ b/js/JoinSecuredNetworkPage.js @@ -39,6 +39,9 @@ _form.attr("id","Join "+_pageData.ssid); _passwordField.val(""); _passwordCloneField.val(""); + }); + $.mobile.document.on( "pageshow", PAGE_ID, function( event, data ) { + d3d.util.autofocus(_form); }); $.mobile.document.on( "pagehide", PAGE_ID, function( event, data ) { console.log(PAGE_ID+" pagehide"); diff --git a/js/main.js b/js/main.js index 2bfa1cd..1848672 100644 --- a/js/main.js +++ b/js/main.js @@ -95,6 +95,12 @@ d3d.util = { console.log("WARNING:"+warning); return warning; }; + }, + autofocus:function(form) { + if (!("autofocus" in document.createElement("input"))) { + var target = form.find("input[autofocus]:visible"); + target.focus(); + } } }; diff --git a/www/index.html b/www/index.html index 6e5a064..0cf1f8f 100644 --- a/www/index.html +++ b/www/index.html @@ -142,7 +142,7 @@