diff --git a/js/JoinSecuredNetworkPage.js b/js/JoinSecuredNetworkPage.js index a1f38b5..43d754b 100644 --- a/js/JoinSecuredNetworkPage.js +++ b/js/JoinSecuredNetworkPage.js @@ -25,30 +25,30 @@ _form = _page.find("form"); _passwordField = _form.find("input[name=password]"); _submitButton = _form.find("input[type=submit]"); - _form.submit(function(){ - console.log("JoinSecuredNetworkPage:submit"); - // ToDo: validation - // http://www.raymondcamden.com/index.cfm/2012/7/30/Example-of-form-validation-in-a-jQuery-Mobile-Application - - var linkParams = _pageData; - linkParams.password = _passwordField.val(); - var submitLink = _form.data("target"); - submitLink = d3d.util.replaceURLParameters(submitLink,_pageData); - $.mobile.changePage(submitLink); - return false; - }); - // ToDo show password button? - // http://unwrongest.com/projects/show-password/ - // http://trevordavis.net/blog/jquery-show-password-plugin - }); + _passwordField.showPassword(); + _form.submit(join); + }); $.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) { console.log(PAGE_ID+" pagebeforeshow"); _pageData = d3d.util.getPageParams(PAGE_ID); console.log(" _pageData: ",_pageData); _title.text("Join "+_pageData.ssid); - + _form.attr("id","Join "+_pageData.ssid); + _passwordField.val(""); }); $.mobile.document.on( "pagehide", PAGE_ID, function( event, data ) { console.log(PAGE_ID+" pagehide"); }); + function join(){ + console.log("JoinSecuredNetworkPage:submit"); + // ToDo: validation + // http://www.raymondcamden.com/index.cfm/2012/7/30/Example-of-form-validation-in-a-jQuery-Mobile-Application + + var linkParams = _pageData; + linkParams.password = _passwordField.val(); + var submitLink = _form.data("target"); + submitLink = d3d.util.replaceURLParameters(submitLink,_pageData); + $.mobile.changePage(submitLink); + return false; + } })(window); \ No newline at end of file diff --git a/www/index.html b/www/index.html index 85dfb07..37967eb 100644 --- a/www/index.html +++ b/www/index.html @@ -138,7 +138,9 @@