0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-12-22 13:13:48 +01:00

Ignore settings form fields with empty name attr on save

This commit is contained in:
peteruithoven 2013-12-23 17:39:37 +01:00
parent d50a42ef09
commit 1f1b6c89dd
2 changed files with 13 additions and 10 deletions

View File

@ -321,7 +321,8 @@ function SettingsWindow() {
var selects = self.form.find("select");
selects.each( function(index,element) {
var element = $(element);
if(element.attr('name') != "network.client.network") {
var fieldName = element.attr('name');
if(element.attr('name') != "") {
settings[element.attr('name')] = element.val();
}
});
@ -329,14 +330,16 @@ function SettingsWindow() {
var inputs = self.form.find("input");
inputs.each( function(index,element) {
var element = $(element);
switch(element.attr("type")) {
case "text":
case "number":
settings[element.attr('name')] = element.val();
break;
case "checkbox":
settings[element.attr('name')] = element.prop('checked')
break;
if(element.attr('name') != "") {
switch(element.attr("type")) {
case "text":
case "number":
settings[element.attr('name')] = element.val();
break;
case "checkbox":
settings[element.attr('name')] = element.prop('checked')
break;
}
}
});

View File

@ -150,7 +150,7 @@
The text <em>%%MAC_ADDR_TAIL%%</em> will be replaced by the last 6 digits of your Doodle3D Wi-Fi box's MAC address.</small>
<br>
<label for="network">Network:</label>
<select id="network" name="network.client.network"></select>
<select id="network" name=""></select>
<input type="button" name="refresh" value="Refresh" class="button" id="refreshNetworks"/><br>
<label for="password" id="passwordLabel">Password:</label><input type="password" name="network.client.password" id="password"><br>
<input type="button" name="connect" value="Connect" class="button" id="connectToNetwork"/>