Skip to content

Commit

Permalink
add checkbox for labelsmode
Browse files Browse the repository at this point in the history
  • Loading branch information
tcatm committed Feb 21, 2011
1 parent c61c39b commit 8c0a96e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions bitcoinapp.js
Expand Up @@ -555,6 +555,7 @@ function BitcoinApp() {
settings.url = getFormValue(this, "url");
settings.user = getFormValue(this, "user");
settings.password = getFormValue(this, "pass");
app.settings.labelsmode = getFormValue(this, "labelsmode");
app.connect(settings);
return false;
});
Expand Down
7 changes: 6 additions & 1 deletion helper.js
Expand Up @@ -12,7 +12,12 @@ function setFormValue(form, name, value) {
}

function getFormValue(form, name) {
return $(form).children('input[name="' + name + '"]').val();
var e = $(form).children('input[name="' + name + '"]');
if (e.get(0).type == "checkbox") {
return e.attr("checked");
}

return e.val()
}

function hideValidation(obj) {
Expand Down
1 change: 1 addition & 0 deletions index.html
Expand Up @@ -74,6 +74,7 @@ <h3 id="section_Settings">Settings / Server Information</h3>
<label>User</label><input name="user" /></br>
<label>Password</label><input name="pass" type="password"/></br>
<label>URL</label><input name="url" value="http://localhost:8332"/></br>
<label></label><input name="labelsmode" type="checkbox" checked /> use labels instead of accounts</br>
<label></label><button>Connect</button><br/>
</form>
<div id="serverInfo">
Expand Down

0 comments on commit 8c0a96e

Please sign in to comment.