Skip to content

Commit

Permalink
html: submit ssid/psk only if ssid is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
librae8226 committed Apr 20, 2016
1 parent 9f2b9cf commit 533b364
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions fs/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13051,34 +13051,6 @@ <h1 class="neurite-splash-head">Neurite</h1>

<script type="text/javascript">

function validate()
{
var ssid = document.getElementById("ssid").value;
var password = document.getElementById("password").value;
if (ssid.length == 0)
return false;
/*alert("ssid: " + ssid + " password: " + password);*/
return true;
}

function subscribe()
{
var e = document.getElementById("email").value;
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)) {
return true;
} else {
return false;
}
}

function httpget(url)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", url, false); // false for synchronous request
xmlHttp.send(null);
return xmlHttp.responseText;
}

function wifiscan()
{
console.log("scan wifi");
Expand Down Expand Up @@ -13113,6 +13085,10 @@ <h1 class="neurite-splash-head">Neurite</h1>
{
var ssid = $('#ssid').dropdown('get value');
var pwd = document.getElementById("password").value;
if (ssid == "[object Object]") {
console.log("no ssid");
return;
}
console.log("here save wifi:", ssid, pwd);

var xmlHttp = new XMLHttpRequest();
Expand Down

0 comments on commit 533b364

Please sign in to comment.